Random()
Syntax
Result = Random(Maximum)Description
Returns a random number (integer) which lies between (and including) 0 and the Maximum value. 'Maximum' may not exceed the positive long value: 2147483647.
Additionally RandomSeed() may be used to change the random number seed. RandomData() can be used to fill a memory buffer with random data.
Note: This command uses a pseudorandom number generator which is very fast and produces randomly looking output but it is not strong enough for cryptographic purposes. The slower CryptRandom() command can be used if more secure random number generation is required.Example:
Repeat Dice = Random(5) + 1 ; get a value between 1 and 6 Choice = MessageRequester("Roll the dice", "You got a "+Str(Dice)+", roll again?", #PB_MessageRequester_YesNo) Until Choice = #PB_MessageRequester_No
Supported OS
All