Random Color

Mike T. Machenry dskippy@ccs.neu.edu
Wed, 20 Nov 2002 20:44:36 -0500


I am trying to construct an infinate list of pairs of random colors.
I am hung up on getting a random color. I have:

data Color = Blue | Red | Green deriving (Eq, Ord, Show)

am I supposed to instantiate a Random class instance from color?
I am not sure exactly how the random number generator works. Is this
the best way to go about it? Should I instead get a random Integer
index of an array of Colors?

thanks,
-mike