Subtractive generator: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: An applicative simplification of the shuffle function) |
|||
Line 900: | Line 900: | ||
where |
where |
||
r = take 55 $ shuffle $ cycle $ take 55 s |
r = take 55 $ shuffle $ cycle $ take 55 s |
||
shuffle x = |
shuffle x = (:) . head <*> shuffle $ drop 34 x |
||
s = mmod $ seed : 1 : zipWith (-) s (tail s) |
s = mmod $ seed : 1 : zipWith (-) s (tail s) |
||
mmod = fmap (`mod` 10 ^ 9) |
mmod = fmap (`mod` 10 ^ 9) |