jaune.target.gb
Class Rand

java.lang.Object
  |
  +--jaune.target.gb.Rand

public final class Rand
extends java.lang.Object


Constructor Summary
Rand()
           
 
Method Summary
static byte arand()
          Generates a random number using the linear lagged additive method.
static void initarand(int 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.
static void initrand(int seed)
          Initalise the random number generator.
static byte rand()
          Returns a random value.
static int randw()
          Returns a random word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rand

public Rand()
Method Detail

initrand

public static final void initrand(int 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.

rand

public static final byte rand()
Returns a random value.

randw

public static final int randw()
Returns a random word.

initarand

public static final void initarand(int 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.

arand

public static final byte arand()
Generates a random number using the linear lagged additive method.