Main Page   Compound List   File List   Header Files   File Members  

rand.h File Reference

Random generator using the linear congruential method. More...


Functions

void initrand (UINT16 seed) NONBANKED
Initalise the random number generator. More...

INT8 rand (void) BANKED
Returns a random value.

UINT16 randw (void) BANKED
Returns a random word.

void initarand (UINT16 seed) BANKED
Random generator using the linear lagged additive method Note that 'initarand()' calls 'initrand()' with the same seed value, and uses 'rand()' to initialize the random generator. More...

INT8 arand (void) BANKED
Generates a random number using the linear lagged additive method.


Detailed Description

Random generator using the linear congruential method.

Author(s):
Luc Van den Borre

Function Documentation

void initrand (UINT16 seed)

Initalise the random number generator.

seed needs to be different each time, else the same sequence will be generated. A good source is the DIV register.

void initarand (UINT16 seed)

Random generator using the linear lagged additive method Note that 'initarand()' calls 'initrand()' with the same seed value, and uses 'rand()' to initialize the random generator.

Author(s):
Luc Van den Borre

Generated at Sat Jul 22 11:34:02 2000 for gbdk-lib by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999