Closed dcsan closed 3 years ago
added code to prevent this crashing, but not sure why - last one seems to always get called with an empty 'entropy' value. i don't see how tho, as the calling function always provides a _rnd
unless it's called from somewhere else.
// returns a function that will return randomness on each call. recycle for limitless fun.
function makeRng (entropy) {
if (!entropy) {
console.warn('makeRng but no entropy', entropy);
entropy = [4, 4, 1, 4, 1, 7, 0, 4, 0, 3, 2]
}
return () => { const x = entropy.shift(); entropy.push(x); return x; }
}
It will crash if you call it with empty data. But if you try to do that, it shouldn't render anything, that's invalid or undefined.
on "YourCollectibles" page