home *** CD-ROM | disk | FTP | other *** search
- FUNCTION Random (VAR Seed : Integer) : Real ;
-
- { Taken from PROGRAMMING IN PASCAL, by Peter Grogono, pp. 117-119,
- with "Modulus" reduced to "Maxint" to accommodate Pascal/Z limits.
- Returns a pseudo-random number between 0 and 1.0, inclusive, and
- should generate "Maxint" (32767) such numbers before repeating itself. }
-
- CONST
- Multiplier = 25173 ;
- Increment = 13849 ;
-
- BEGIN { Random }
-
- Random := Seed / Maxint ;
- Seed := Abs ((Seed * Multiplier + Increment) MOD Maxint) ;
-
- END { Random } ;
- N { Random }
-
- Random := Seed / Maxint ;
- Seed := Abs ((Seed * Multiplier + Increment) MOD Maxint) ;!╬═╖ ┬Æ═P═î ├Q!µ═╖ ┬¬═P═} ═Qx├Q!Ω═╖ ┬╞═█ ═ô G@═█ ▒░├Q!
- ═╖ ┬▄y═ô GÇ├╛!═╖ ┬⌠═█ ═ô ▒├Q!═╖ ┬═