LoginLogin
Might make SBS readonly: thread

RND

Root / Documentation / [.]

Created:
Generate a random integer. The number will be greater than or equal to 0 and less than the specified maximum; or 0 <= number < maximum.

Syntax

RND { genID%, } maximum% OUT num%
InputDescription
genID%ID of the generator to use, 0-7. Optional, 0 if omitted.
maximum%The upper limit of numbers to generate.
OutputDescription
num%The generated number. 0 <= num% < maximum%

Examples

' generate a random number from 0..9
PRINT RND(10)
'use different generators and seeds
RANDOMIZE 0,10
RANDOMIZE 1,20
PRINT RND(0,10)
PRINT RND(1,10)

No posts yet (will you be the first?)