Functions for working with randomness.
local Rand = ELONA.require("core.Rand")
| rnd (n) | Returns a random number from 0 to n, exclusive. |
| rnd_capped (n) | Returns a random number from 0 to min(n, 32768), exclusive. |
| one_in (n) | Returns true one out of every n times. |
| coinflip () | Returns true 50% of the time. |
| between (min, max) | Returns a random number from min to max, exclusive. |
| choice (table) | Returns a random object from a table. |
Returns a random number from 0 to n, exclusive.
Parameters:
Returns a random number from 0 to min(n, 32768), exclusive.
It emulates vanilla's random number generation, capped by the upper limit.
Parameters: