<> <> <> <> <<>> Random: CEDAR DEFINITIONS = BEGIN RandomStream: TYPE = REF RandomStreamRep; RandomStreamRep: TYPE = RECORD [ seed: INT _ 0, data: REF _ NIL]; Create: PROC [range: INT _ 0, seed: INT _ 0] RETURNS [rs: RandomStream]; <0, seed is scaled if necessary and then used; if seed<0, a seed value is derived from the system clock. In any case, the seed value actually used (after scaling) is in rs.seed. Using the same seed will allow reproducible pseudo-random sequences.>> <> <<>> NextInt: PROC [rs: RandomStream _ NIL] RETURNS [INT]; <> ChooseInt: PROC [rs: RandomStream _ NIL, min: INT _ 0, max: INT] RETURNS [INT]; <> < max), or if the interval length (max-min+1) exceeds the range of numbers the generator was initialized to produce, raises ERROR BadInterval.>> BadInterval: ERROR; END. <> <> <> <> <> <> <> <<...;>> <> <> <> <> <> <> <<...>> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>> <> <> <<>>