Difference between revisions of "GetRandomPercent"

Jump to navigation Jump to search
257 bytes added ,  10:44, 11 June 2006
Examples
imported>Mrflippy
(Random value between min and max)
imported>JOG
(Examples)
To generate a random number between min and max:
<pre>set randVal to min + (GetRandomPercent * (max - min)) / 99</pre>
 
'''Examples:'''
short dice
set dice to 1 + 0.06 * GetRandompercent ; => 1 to 6 (5.94 is truncated to 5)
 
float rnd
set rnd to 0.05 * Getrandompercent ; => 0.00 to 4.95
 
float rnd
set rnd to 5/99 * Getrandompercent ; => 0.00 to 5.00
 
[[Category: Functions]]
Anonymous user

Navigation menu