[Haskell-cafe] Random Number

José Prous hiena03 at gmail.com
Sun Jun 7 15:55:35 EDT 2009


look in System.Random
randomRIO :: (Random a) => (a, a) -> IO a

you can do
randomNumber<-randomRIO (1,30)


On Sun, Jun 7, 2009 at 3:33 PM, ptrash <ptrash at web.de> wrote:

>
> Hi,
>
> is the are way (or a build in method) in haskell to get a random number
> from
> a number bottom to a number top?
>
> Something like
>
> let randomNumber = random 1 30
>
> to get a random number between 1 and 30.
> --
> View this message in context:
> http://www.nabble.com/Random-Number-tp23914474p23914474.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090607/53fb83ef/attachment.html


More information about the Haskell-Cafe mailing list