Static
createCreate a new instance of a random number generator.
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()
.
Static
new
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.