org.zmpp.vmutil
Class PredictableRandomGenerator
java.lang.Object
org.zmpp.vmutil.PredictableRandomGenerator
- All Implemented Interfaces:
- RandomGenerator
public class PredictableRandomGenerator
- extends Object
- implements RandomGenerator
This class implements the predictable random number generator mentioned
in the Z machine standards document. It takes a seed and generates the
same sequence of numbers for equal seeds.
- Version:
- 1.0
- Author:
- Wei-ju Wu
Method Summary |
int |
next()
Returns the next random value between 1 and MAX_VALUE. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PredictableRandomGenerator
public PredictableRandomGenerator(long seed)
- Constructor.
- Parameters:
seed
- the start seed.
next
public int next()
- Returns the next random value between 1 and MAX_VALUE.
- Specified by:
next
in interface RandomGenerator
- Returns:
- a random int value
Copyright © 2005 . All Rights Reserved.