Random A
Remember to include System.Random
to make these exercises work.
-
Print a random integer in the range [1,10].
-
Print a random Double in the range [100,200].
-
Make a circle of radius 2 centered at the origin with a random color from this list:
somecolors = [red, orange, yellow, green, blue, purple]
-
Create a function that takes in a
StdGen
and produces a random color from thesomecolors
list (above). -
Create a
CS
record (data
) that holds apt :: Point
, acx :: Color
, and agen :: StdGen
. -
Given a
CS
record, draw a solid radius 1.0 circle of that color at the point in the record. -
Make a drawing that selects new a random coordinate and color every time the person hits a key. Except hitting “C” should just randomly change the color.