File size: 307 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function RandomSeed() {
}
// adapted from: https://stackoverflow.com/a/19303725
RandomSeed.seed = 1;
RandomSeed.x = 0;
RandomSeed.nextDouble = function () {
RandomSeed.x = Math.sin(RandomSeed.seed++) * 10000;
return RandomSeed.x - Math.floor(RandomSeed.x);
};
module.exports = RandomSeed;
|