.Math. SeededRandom

Randomizer class that's seedable with a random integer (mulberry32 by Tommy Ettinger, under public domain).

Constructor

new SeededRandom(seed, integer)

Create a new randomizer with a seed to extract values from.

Parameters:
NameTypeDefaultDescription
seednumber

Integer to use as seed, defaults to current time in milliseconds.

integerbooleanfalse

Whether to return integers or floats.

Methods

value(low, high, integer) → {number}

Get a random value.

Parameters:
NameTypeDefaultDescription
lownumber0

The lowest value to return (inclusive).

highnumber1

The highest value to return (exclusive), if 'integer' is true, this will default to the unsigned 32-bit integer max (4294967296).

integerbooleanthis.integer

Whether to return integers or floats, defaults to the value set in the constructor.

Returns:
Type: 
number