GameMaker's random numbers: the runtime's WELL512a generator, seeded as
random_set_seed seeds it, giving what random, random_range, irandom,
irandom_range and choose give.
random = Random.new(1234)
{value, random} = Random.random(random, 10)A seed fills every one of the sixteen words of state with
(seed × 0x343FD + 0x269EC3) >> 16 and starts at word 0. Each draw is one 32-bit
output; random(n) is that output × 2⁻³² × n.
Summary
Functions
One of values (choose): one output modulo how many there are picks it.
A whole number from 0 to n inclusive, or from n to 0 when n is negative
(irandom(n)): two outputs make a 63-bit number, the second's low 31 bits above the
first's 32, taken modulo |n| + 1 and given n's sign.
A whole number from low to high inclusive (irandom_range).
A generator seeded with seed (random_set_seed).
The next 32-bit output, and the generator after it.
A real from 0 up to n (random(n)).
A real from low up to high (random_range).
Types
Functions
One of values (choose): one output modulo how many there are picks it.
A whole number from 0 to n inclusive, or from n to 0 when n is negative
(irandom(n)): two outputs make a 63-bit number, the second's low 31 bits above the
first's 32, taken modulo |n| + 1 and given n's sign.
A whole number from low to high inclusive (irandom_range).
A generator seeded with seed (random_set_seed).
@spec next(t()) :: {non_neg_integer(), t()}
The next 32-bit output, and the generator after it.
A real from 0 up to n (random(n)).
A real from low up to high (random_range).