Difference between revisions of "love.math.getRandomState"

 
(Created page)
 
Line 1: Line 1:
#REDIRECT [[love.math.getRandomSeed]]
+
{{newin|[[0.9.1]]|091|type=function}}
 +
Gets the current state of the random number generator. This returns an opaque implementation-dependent string which is only useful for later use with [[love.math.setRandomState]] or [[RandomGenerator:setState]].
 +
 
 +
This is different from [[love.math.getRandomSeed]] in that getRandomState gets the random number generator's current state, whereas getRandomSeed gets the previously set seed number.
 +
 
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
state = love.math.getRandomState( )
 +
</source>
 +
=== Arguments ===
 +
None.
 +
=== Returns ===
 +
{{param|string|state|The current state of the random number generator, represented as a string.}}
 +
== Notes ==
 +
The value of the state string does not depend on the current operating system.
 +
== See Also ==
 +
* [[parent::love.math]]
 +
* [[love.math.setRandomState]]
 +
[[Category:Functions]]
 +
{{#set:Description=Gets the current state of the random number generator.}}
 +
== Other Languages ==
 +
{{i18n|love.math.getRandomState}}

Latest revision as of 02:04, 5 May 2019

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

Gets the current state of the random number generator. This returns an opaque implementation-dependent string which is only useful for later use with love.math.setRandomState or RandomGenerator:setState.

This is different from love.math.getRandomSeed in that getRandomState gets the random number generator's current state, whereas getRandomSeed gets the previously set seed number.

Function

Synopsis

state = love.math.getRandomState( )

Arguments

None.

Returns

string state
The current state of the random number generator, represented as a string.

Notes

The value of the state string does not depend on the current operating system.

See Also

Other Languages