davidbau / seedrandom

seeded random number generator for Javascript
2.04k stars 160 forks source link

Is there a way to turn the seedrandom off? #78

Closed danzen closed 1 year ago

danzen commented 1 year ago

I would like to go back to a normal Math.random() part way through my script. And I do want to initially adjust the Math.random() - not get a local PRNG. Is there a way to do this? Cheers.

danzen commented 1 year ago

Oh... I figured out a way... const r = Math.random; seedrandom(1000000); // do stuff... // then... Math.random = r; // we are back to normal

danzen commented 1 year ago

Oh - saw there was already an issue for unset... sorry for the duplicate! Same answer too.