$std::prng
This module uses a 64bit Mersenne Twister to generate pseudorandom numbers.
The output of the generator is completely deterministic and depends only on the initial seed value, i.e. the sequence of numbers generated will always be identical for a given seed.
The generator is automatically initialized at startup using a random seed but you can reinitialize the generator at any time by calling seed(arg)
. This reseeds the generator using the argument's 64bit hash value.
Functions

rand_float()

Returns a uniformlydistributed random
$f64
from the halfopen interval[0, 1)
, i.e. the interval from zero up to but not including 1. The generator produces floats with 53 bits of precision. 
rand_int(n)

Returns a uniformlydistributed random
$i64
from the halfopen interval[0, n)
, i.e. the interval from zero up to but not includingn
, wheren
is a positive integer. 
rand_int_in_range(lower, upper)

Returns a uniformlydistributed random
$i64
from the halfopen interval[lower, upper)
, i.e. the interval fromlower
up to but not includingupper
.The arguments can be positive or negative or mixed as long as
lower
is less than or equal toupper
. 
seed(arg)

Seeds the generator using the argument's 64bit hash.

shuffle(vec)

Shuffles the vector
vec
inplace. Uses FisherYates/Durstenfeld shuffling.