[Haskell-cafe] What's the best seed for random API ?

2011-01-05 Thread z_axis
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

Re: [Haskell-cafe] What's the best seed for random API ?

2011-01-05 Thread Alex Rozenshteyn
Admittedly, I don't know much about this from the haskell end or about the particular api. If you want statistical randomness, your seed doesn't matter; just the PRNG. I might even have seeded with a constant or taken the seed from the user. Seeding from urandom will make your output more

Re: [Haskell-cafe] What's the best seed for random API ?

2011-01-05 Thread Robert Clausecker
It probably is, but definitly not portable. Try to find /dev/urandom under Windows. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe