[Haskell-cafe] Generate 50 random coordinates

Taral taralx at gmail.com
Sat Dec 2 02:29:59 EST 2006


On 12/2/06, Huazhi (Hank) Gong <hankgong at nm.gist.ac.kr> wrote:
> myrand :: Int
> myrand = randomRIO(1::Int, 100)
>
> rf=[(myrand, myrand) | a <- [1..50]]

do
    let myrand = randomRIO (1 :: Int, 100)
    rf <- replicateM 50 (liftM2 (,) myrand myrand)

-- 
Taral <taralx at gmail.com>
"You can't prove anything."
    -- Gödel's Incompetence Theorem


More information about the Haskell-Cafe mailing list