RandomNumberGenerator

Implements a pseudo-random number generator using a 64 bit Fibonacci LFSR.

Example uses: * rng.seed() % maxAmount * (rng.seed() % 100) < probabilityOfEvent

Constructors

this
this(ulong reg)

Creates the LFSR, and initializes it by calling its seed function 64 times.

Members

Functions

dice
ulong dice(uint s)

Calls seed, then returns the remainder of the seed divided by s. Intended to simplify the use of rng.seed() % s style of use of this

opCall
ulong opCall()
Undocumented in source. Be warned that the author may not have intended to support it.
seed
ulong seed()

Shuffles the register's content, then returns it.

Variables

reg
ulong reg;
Undocumented in source.

Meta