seedrandom
seedrandom copied to clipboard
Is there a way to go back steps and repeat them?
Not sure if saving the state is how to do this. I want to be able to go back a number of steps and repeat the random numbers again from there. So:
const r = seedrandom(100000); console.log(Math.random(), Math.random(), Math.random()); // .78, .55. .13 // shortened ;-) r.step(-3); console.log(Math.random(), Math.random(), Math.random()); // .78, .55. .13