Difference between revisions of "love.math.setRandomState"

 
(Created page)
 
Line 1: Line 1:
#REDIRECT [[love.math.setRandomSeed]]
+
{{newin|[[0.9.1]]|091|type=function}}
 +
Sets the current state of the random number generator. The value used as an argument for this function is an opaque implementation-dependent string and should only originate from a previous call to [[love.math.getRandomState]].
 +
 
 +
This is different from [[love.math.setRandomSeed]] in that setRandomState directly sets the random number generator's current implementation-dependent state, whereas setRandomSeed gives it a new seed value.
 +
 
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
love.math.setRandomState( state )
 +
</source>
 +
=== Arguments ===
 +
{{param|string|state|The new state of the random number generator, represented as a string. This should originate from a previous call to [[love.math.getRandomState]].}}
 +
=== Returns ===
 +
Nothing.
 +
== Notes ==
 +
The effect of the state string does not depend on the current operating system.
 +
== See Also ==
 +
* [[parent::love.math]]
 +
* [[love.math.getRandomState]]
 +
[[Category:Functions]]
 +
{{#set:Description=Sets the current state of the random number generator.}}
 +
== Other Languages ==
 +
{{i18n|love.math.setRandomState}}

Latest revision as of 02:00, 5 May 2019

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

Sets the current state of the random number generator. The value used as an argument for this function is an opaque implementation-dependent string and should only originate from a previous call to love.math.getRandomState.

This is different from love.math.setRandomSeed in that setRandomState directly sets the random number generator's current implementation-dependent state, whereas setRandomSeed gives it a new seed value.

Function

Synopsis

love.math.setRandomState( state )

Arguments

string state
The new state of the random number generator, represented as a string. This should originate from a previous call to love.math.getRandomState.

Returns

Nothing.

Notes

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

See Also

Other Languages