GML Functions: Random Functions

These following functions deal with random numbers: (You can click on the function name to get additional information.)


 * random(x) Returns a random real number between 0 and x. The number is always smaller than x.
 * random_range(x1,x2) Returns a random real number between x1 (inclusive) and x2 (exclusive).
 * irandom(x) Returns a random integer number between 0 and x (inclusive when x is an integer).
 * irandom_range(x1,x2) Returns a random real number between x1 (inclusive) and x2 (inclusive). Both x1 and x2 must be integer values (otherwise they are rounded down).
 * random_set_seed(seed) Sets the seed (an integer) that is used for the random number generation. Can be used to repeat the same random sequence. (Note though that also some actions and the system itself uses random numbers.
 * random_get_seed Returns the current seed.
 * randomize Sets the seed to a random number.
 * choose(val1,val2,val3,...) Returns one of the arguments choosen randomly. The function can have up to 16 arguments.