Exported Functions | |
---|---|
d/2 | Simulates rolling N dice of M faces each. |
dist/1 | Picks a random element M from a list of pairs
{N, M} where N is the
percentage chance of M being returned. |
pick/1 | Picks a random element from a tuple or a list (equal chance for every element.). |
scramble/1 | Randomizes the order of a tuple or list. |
seed/0 | Seeds the random number generator so that it will produce unpredictable values. |
d(NumberOfDice::integer(), FacesPerDie::integer()) -> integer()
Simulates rolling N dice of M faces each.
dist(distribution()) -> term()
Picks a random element M
from a list of pairs
{N, M}
where N
is the
percentage chance of M
being returned.
pick(tuple() | [term()]) -> term()
Picks a random element from a tuple or a list (equal chance for every element.)
scramble(tuple() | [term()]) -> tuple() | [term()]
Randomizes the order of a tuple or list.
seed() -> ok
Seeds the random number generator so that it will produce unpredictable values. Should be called once at the startup of the process, before using random numbers.