random

v0.1.7
random();

Get a random number.

random(max);

Arguments

maxThe maximum of the range
random()      -- random number between 0 and 1
random(3)     -- random number between 0 and 3
random(min, max);

Arguments

minThe minimum of the range
maxThe maximum of the range
random(3, 12) -- random number between 3 and 12
random(arr);

Arguments

arrThe array to randomly select an item from
random({ 'A', 'B', 'C' }) -- random element in table

Returns

numberThe random value

See random in lu5_math.h