Class Random

(foreign) class Random {
    unsigned long long mt[NN];
    int mti;
}

The Random class provides access to the random number generator. Each instance is completely separate from all others.

The constructor for this class takes a seed. If the seed provided is 0 or less, then the current time (time(NULL) in C) is used instead.

Methods

define <new>(seed: *Integer = 0): Random constructor

define between(lower: Integer, upper: Integer): Integer

Generate a random Integer value between lower and upper.

  • ValueError is raised if the range is empty, or reversed.