RandomGenerator:setSeed

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Sets the seed of the random number generator using the specified integer number.

Function

Synopsis

RandomGenerator:setSeed( seed )

Arguments

number seed
The integer number with which you want to seed the randomization. Must be within the range of [1, 2^53].

Returns

Nothing.

Notes

Due to Lua's use of double-precision floating point numbers, values above 2^53 cannot be accurately represented. Use the other variant of this function if your seed will have a larger value.

Function

Combines two 32-bit integer numbers into a 64-bit integer value and sets the seed of the random number generator using the value.

Synopsis

RandomGenerator:setSeed( low, high )

Arguments

number low
The lower 32 bits of the seed value. Must be within the range of [0, 2^32 - 1].
number high
The higher 32 bits of the seed value. Must be within the range of [0, 2^32 - 1].

Returns

Nothing.

See Also

Other Languages