Subtractive generator: Difference between revisions
m
→{{header|Haskell}}: An applicative simplification of the shuffle function
m (→{{header|Phix}}: syntax coloured) |
m (→{{header|Haskell}}: An applicative simplification of the shuffle function) |
||
Line 897:
subtractgen seed = drop 220 out
where
out = mmod $ r
where
r = take 55 $ shuffle $ cycle $ take 55 s
shuffle x =
s = mmod $ seed : 1 : zipWith (-) s (tail s)
mmod =
main :: IO ()
|