
5 Jan
2011
5 Jan
'11
7:21 p.m.
picoSec :: IO Integer picoSec = do t <- ctPicosec `liftM` (getClockTime >>= toCalendarTime) return t rollDice :: Int -> IO Int rollDice n = do ps <- picoSec return $ (take 1 $ randomRs (1,n) $ mkStdGen $ fromInteger ps) !! 0 The above code uses `ctPicosec` as seed. Is it better to use the output of /dev/urandom as seed ? Sincerely! ----- e^(π.i) + 1 = 0 -- View this message in context: http://haskell.1045720.n5.nabble.com/What-s-the-best-seed-for-random-API-tp3... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.