Random
class Random
A random number generator based on
Mulberry32.
Constructors
constructor
Parameters
state: number
Methods
floatArray
Get an array filled with random floats in the given range.
Parameters
size: numberThe size of the array.
from: number = 0The start of the range.
to: number = 1The end of the range.
gauss
Get a random float from a gaussian distribution.
Parameters
mean: number = 0The mean of the distribution.
stdev: number = 1The standard deviation of the distribution.
intArray
Get an array filled with random integers in the given range.
Parameters
size: numberThe size of the array.
from: number = 0The start of the range.
to: number = 4294967296The end of the range. Exclusive.
nextFloat
Get the next random float in the given range.
Parameters
nextInt
Get the next random integer in the given range.
Parameters
spawn
public spawn(): Random
Create a new independent generator.