gm2-libs-log/Random (The GNU Modula-2 Compiler)

#### 4.2.19 gm2-libs-log/Random ¶

    DEFINITION MODULE Random ;

    FROM SYSTEM IMPORT BYTE ;
    EXPORT QUALIFIED Randomize, RandomInit, RandomBytes, RandomCard, RandomInt, RandomReal, RandomLongReal ;

    (*
       Randomize - initialize the random number generator with a seed
                   based on the microseconds.
    *)

    PROCEDURE Randomize ;

    (*
       RandomInit - initialize the random number generator with value, seed.
    *)

    PROCEDURE RandomInit (seed: CARDINAL) ;

    (*
       RandomBytes - fills in an array with random values.
    *)

    PROCEDURE RandomBytes (VAR a: ARRAY OF BYTE) ;

    (*
       RandomInt - return an INTEGER in the range 0..bound-1
    *)

    PROCEDURE RandomInt (bound: INTEGER) : INTEGER ;

    (*
       RandomCard - return a CARDINAL in the range 0..bound-1
    *)

    PROCEDURE RandomCard (bound: CARDINAL) : CARDINAL ;

    (*
       RandomReal - return a REAL number in the range 0.0..1.0
    *)

    PROCEDURE RandomReal () : REAL ;

    (*
       RandomLongReal - return a LONGREAL number in the range 0.0..1.0
    *)

    PROCEDURE RandomLongReal () : LONGREAL ;

    END Random.