Random(a:Int, [b:Int]):Int

Generate random number. With one parameter, generates a random number in range [0,a) (i.e. including zero, not including a). With two parameters, generates a random number in range [a,b) (i.e. including a, not including b).

For example, Random(10) generates random numbers between 0 and 9, as does Random(0, 10).

Random(1,500) generates random numbers between 1 and 499, Random(500,1) generates random numbers between 2 and 500 (the first parameter always included in the range, the second one is not).

The maximum value for either parameter is 32767 (=15 bit).

See also: Functions