UNPKG

quxapp

Version:

Qux App is a lightweight module that contains many functions for array operations, sequences, and statistics. Qux App makes writing JavaScript easier and quicker every day!

11 lines (10 loc) 272 B
function tree(spread, depth, callback) { const list = [] for (n = 0; n < spread ** depth; n++) { for (i = 0; i < depth; i++) { list[i] = Math.floor((n * spread ** (i + 1) / (spread ** depth))) % spread } callback(list, n) } } module.exports = tree