Difference between revisions of "Random"

From Wiki
Jump to: navigation, search
m (Example)
m (Example)
Line 4: Line 4:
 
==== Example ====
 
==== Example ====
 
<pre>
 
<pre>
 
 
;make a random number between 0 and 99.
 
;make a random number between 0 and 99.
 
set %a #random % 100
 
set %a #random % 100
  
 
+
;make a random number between a range of two numbers
;make a random number between two set numbers  
+
;set %random1 #random % %increments + #bottom
set %random1 #random % %increments + %base
+
 
;%increments is (top# - bottom#) + 1
 
;%increments is (top# - bottom#) + 1
;%base is the number closer to 0 from your list of numbers.
+
;#top is the highest number of the range
 
+
;#bottom is the lowest number of the range
;Example of two random numbers between 3 and 10 ;set %random1 #random % 8 + 3
+
;example of two random numbers between 3 and 10
 +
set %random1 #random % 8 + 3
 
</pre>
 
</pre>
 
{{footer}}
 
{{footer}}

Revision as of 09:00, 11 January 2007

Holds a changing random value that ranges between 0 and 999.

Example

;make a random number between 0 and 99.
set %a #random % 100

;make a random number between a range of two numbers
;set %random1 #random % %increments + #bottom
;%increments is (top# - bottom#) + 1
;#top is the highest number of the range
;#bottom is the lowest number of the range
;example of two random numbers between 3 and 10
set %random1 #random % 8 + 3

See also

Main Page Documentation