Module ce_random

Pseudo-random numbers library.

Description

Pseudo-random numbers library.

Function Index

d/2Simulates rolling N dice of M faces each.
dist/1Picks a random element M from a list of pairs {N, M} where N is the percentage chance of M being returned.
pick/1Picks a random element from a tuple or a list (equal chance for every element.).
scramble/1Randomizes the order of a tuple or list.
seed/0Seeds the random number generator so that it will produce unpredictable values.

Function Details

d/2

d(NumberOfDice::integer(), FacesPerDie::integer()) -> integer()

Simulates rolling N dice of M faces each.

dist/1

dist(List::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/1

pick(Tuple::tuple() | [term()]) -> term()

Picks a random element from a tuple or a list (equal chance for every element.)

scramble/1

scramble(Tuple::tuple() | [term()]) -> tuple() | [term()]

Randomizes the order of a tuple or list.

seed/0

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.


Generated by EDoc, Feb 18 2008, 06:48:01.