// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
abstract public class SimpleRNG implements RNG {
   // interface
   abstract public void init(int seed);
   abstract public int getMaxInt();
   abstract public int getInt();
   public int getInt(int n) {
      return (getInt() % n);
   }
   public double getDouble() {
      return ((double)getInt() / (double)getMaxInt());
   }
}
