[Haskell-cafe] Generate 50 random coordinates

Huazhi (Hank) Gong hankgong at nm.gist.ac.kr
Sat Dec 2 02:20:48 EST 2006


Hello,all

My intention is to generate 50 random coordinates like (x,y).

myrand :: Int
myrand = randomRIO(1::Int, 100)

rf=[(myrand, myrand) | a <- [1..50]]

My short program is like this. However, GHCI say that the return type of
randomRIO is IO a while the function defined by me is Int. Since I only need
a integral type as my cooridinate, could you tell me how to fix this?

Hank
-- 
View this message in context: http://www.nabble.com/Generate-50-random-coordinates-tf2742242.html#a7651116
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list