Closed Rizean closed 4 years ago
There's no bug here. The State.prng.init()
API doc notes exactly which APIs it affects.
If you want to replace Math.random()
with the seedable PRNG instance created by State.prng.init()
, then you may do so. It does not happen by default for various reasons, not the least of which that 3rd-party libraries that want randomness generally don't expect/want it to deterministic.
either
usesarray.prototype.random
which usesArray.random
is deprecated. This effectively makeeither
not useable when you useState.prng.init()
as the random generated called is the nativeMath.random
.Good -
__random
references the expected random functionBad -
__arrayRandom
references the deprecated random functionBad -
__either
references the deprecated Array.random function