mainly new comments

This commit is contained in:
ceriel
1988-02-19 15:54:01 +00:00
parent 96fc577b15
commit 31ddd5ca12
61 changed files with 529 additions and 58 deletions

View File

@@ -1,5 +1,15 @@
(*
(c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
See the copyright notice in the ACK home directory, in the file "Copyright".
*)
(*$R-*)
IMPLEMENTATION MODULE random;
(*
Module: random numbers
Author: Ceriel J.H. Jacobs
Version: $Header$
*)
FROM Unix IMPORT getpid, time;
TYPE index = [0..54];
@@ -21,12 +31,17 @@ BEGIN
RETURN lwb + (Random() MOD (upb - lwb + 1));
END Uniform;
PROCEDURE StartSeed(seed: CARDINAL);
BEGIN
X[0] := time(NIL);
X[0] := CARDINAL(getpid()) * X[0];
X[0] := seed;
FOR k := 1 TO 54 DO
X[k] := X[k-1] * 1297;
END;
k := 54;
j := 30;
END StartSeed;
BEGIN
X0 := time(NIL);
StartSeed(CARDINAL(getpid()) * X[0]);
END random.