StaticanyStaticcreateCreate a new instance of a random number generator.
Also consider Random.fromString() which is slightly newer.
This only works with seeds that have been created and saved by
this class. Random.fromString() can turn any string into a
seed.
The result from a previous call to Random.newSeed().
By default this will create a new seed.
Either way the seed will be sent to the JavaScript console.
Typical use: Use the default until you want to repeat something. Then copy the last seed from the log and use here.
A function that can be used as a drop in replacement for Math.random().
StaticfromCreate a new random number generator based on a string. The result will be repeatable. I.e. the same input will always lead the the same random number generator.
Any string is acceptable. This can include random things like "try again 27".
And it can include special things like "[1,2,3,4]" which are generated by this library. randomNumberGenerator.currentSeed() will return a seed that can be used to clone the random number generator in its current state.
A new random number generator.
StaticnewStaticseedStatictest
This provides a random number generator that can be seeded.
Math.rand()cannot be seeded. Using a seed will allow me to repeat things in the debugger when my program acts strange.