randi(a?: number, b?: number): number

rand() but floored to integer. If not arguments, returns 0 or 1.

parama- The lower bound. If not upper bound, this is the upper bound.

paramb- The upper bound.

randi(); // returns either 0 or 1
randi(10); // returns a random integer between 0 and 9
randi(10, 20); // returns a random integer between 10 and 19

returnsA random integer between 0 and 1.

sincev2000.0

kaplay logo

Misc

Layer