The Mersenne Twister random number generator. .. note:: The procs in this module work at compile-time.
Example:
import pure/mersenne var rand = newMersenneTwister(uint32.high) ## must be "var" doAssert rand.getNum() != rand.getNum() ## pseudorandom number
Procs
proc getNum(m: var MersenneTwister): uint32 {....raises: [], tags: [].}
- Returns the next pseudorandom uint32. Source Edit
proc newMersenneTwister(seed: uint32): MersenneTwister {....raises: [], tags: [].}
- Creates a new MersenneTwister with seed seed. Source Edit