mardi 9 juin 2015

List with random numbers in Haskell

I want to generate a list with random numbers in Haskell. I have to use the import System.Random library. I started doing something like that but it doesn't work. I have to create a list with N positions, and all these positions must have random numbers. Thanks!

System.Random library
import System.IO

x = randomRIO (1,6::Int) 

test :: IO Int
test = randomRIO (1,6::Int)




Aucun commentaire:

Enregistrer un commentaire