0joshuaolson1 / factoradic

Invertible transformations on permutation representations, including an RNG-free in-place Fisher-Yates-Knuth shuffle https://www.npmjs.com/package/factoradic
https://www.npmjs.com/package/factoradic
Apache License 2.0
0 stars 0 forks source link

Array.apply is limited to small arrays #28

Closed 0joshuaolson1 closed 6 years ago

0joshuaolson1 commented 6 years ago

Functional is not first class - thanks, unoptimized call stack implementation detail leakage. Instead:

function P(l){var a = Array(l); loop(0, l-1, function(l){a[l] = l;}); return a;}

, or equally

function P(l){for(var a = Array(l); a[--l] = l;); return a;}
0joshuaolson1 commented 6 years ago

npm publish'd