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: number
The size of the array.
from: number = 0
The start of the range.
to: number = 1
The end of the range.
gauss
Get a random float from a gaussian distribution.
Parameters
mean: number = 0
The mean of the distribution.
stdev: number = 1
The standard deviation of the distribution.
intArray
Get an array filled with random integers in the given range.
Parameters
size: number
The size of the array.
from: number = 0
The start of the range.
to: number = 4294967296
The 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.