seedrandom icon indicating copy to clipboard operation
seedrandom copied to clipboard

Is there a way to go back steps and repeat them?

Open danzen opened this issue 1 year ago • 1 comments

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

danzen avatar Jan 19 '23 23:01 danzen