(* random.sig *) (* Copyright (C) 2007 Alley Stoughton This file is part of crypto, a cryptogram encoder/decoder. See the file COPYING.txt for copying and usage restrictions *) (* signature of structure for generating random numbers *) signature RANDOM = sig (* random number seed *) type seed (* make a seed that is a function of the current time *) val makeFromTime : unit -> seed exception BadRange val getInRange : seed * int * int -> seed * int (* if m <= n, then getInRange(seed, m, n) "randomly" turns seed into a new seed, uses modular arithmetic to turn this new seed into a number in the range m to n, and returns the new seed and this number; otherwise getInRange raises BadRange *) end;