How to get different two random numbers
6 Oct
2004
6 Oct
'04
3:52 a.m.
How to get different two random numbers, and use the two numbers in program,e.g x = b + c where b && c are different random numbers between 1..n
6 Oct
6 Oct
7:23 a.m.
ldou, LD> How to get different two random numbers, and use the two LD> numbers in program,e.g LD> x = b + c LD> where LD> b && c are different random numbers between 1..n Have a look at the Random module from the standard libraries.
module Test where import Random
test :: Integer -> IO Integer test n = do b <- randomRIO (1, n) c <- randomRIO (1, n) let x = b + c return x
HTH, Stefan
7997
Age (days ago)
7997
Last active (days ago)
1 comments
2 participants
participants (2)
-
ldou -
Stefan Holdermans