public void putSeed(long x) {
/* ---------------------------------------------------------------
 * Use this function to set the state of the current random number
 * generator stream according to the following conventions:
 *    if x > 0 then x is the state (unless too large)
 *    if x < 0 then the state is obtained from the system clock
 *    if x = 0 then the state is to be supplied interactively
 * ---------------------------------------------------------------
 */
    boolean ok = false;

    if (x > 0)
      x = x % MODULUS;                            /* correct if x is too large  */
    if (x < 0) {
      Date now = new Date();
      x = now.getTime();
      //x = ((unsigned long) time((time_t *) NULL)) % MODULUS;
      x=x%MODULUS;// AGGIUNTA DA ME
    }
    if (x == 0)
      while (!ok) {
        try {
          System.out.print("\nEnter a positive integer seed (9 digits or less) >> ");
          String line;
          InputStreamReader r = new InputStreamReader(System.in);
          BufferedReader ReadThis = new BufferedReader(r);
	  
          line = ReadThis.readLine();
          x = Long.parseLong(line);
        } catch (IOException e) {
        } catch (NumberFormatException nfe) {
        }
        ok = (0 < x) && (x < MODULUS);
        if (!ok)
          System.out.println("\nInput out of range ... try again");
      }
      
    seed[stream] = x;
  }