Difference between revisions of "Random"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Returns a pseudo-random int in the range 0 to the given max int. </onlyinclude> <syntaxhighlight lang="cpp"> int Random(int max) </syntaxhighlight> [[Category:Scri...")
 
Line 2: Line 2:
 
Returns a pseudo-random int in the range 0 to the given max int.
 
Returns a pseudo-random int in the range 0 to the given max int.
 
</onlyinclude>
 
</onlyinclude>
 +
 +
This method has two variants. One of them also accepts a seed.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
int Random(int max)
 
int Random(int max)
 +
int Random(u32 seed, u32 max)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Global Functions]]
 
[[Category:Global Functions]]

Revision as of 17:59, 22 August 2012

Returns a pseudo-random int in the range 0 to the given max int.


This method has two variants. One of them also accepts a seed.

int Random(int max)
int Random(u32 seed, u32 max)