Random number generator (included): Difference between revisions

m
(Added FutureBasic example)
Line 316:
 
=={{header|FutureBasic}}==
<lang>
Syntax:
randomInteger = rnd(expr)
Line 329 ⟶ 328:
 
This statement "seeds" the random number generator: this affects the sequence of values which are subsequently returned by the rnd function and the maybe function. The numbers returned by rnd and maybe are not truly random, but follow a "pseudo-random" sequence which is uniquely determined by the seed number (expr). If you use the same seed number on two different occasions, you'll get the same sequence of "random" numbers both times. When you execute random without any expr parameter, the system's current time is used to seed the random number generator.
 
</lang>
Example:
To get a random integer between two arbitrary limits min and max, use the following statement. (Note: max - min must be less than or equal to 65536.):
729

edits