Jump to content

One-dimensional cellular automata: Difference between revisions

→‎{{header|Haskell}}: Dropped liftM2 and ap for the more current Applicatiive liftA2 and <*>
m (removed duplicated line: <lang algol68>INT stop generation = 9;)
(→‎{{header|Haskell}}: Dropped liftM2 and ap for the more current Applicatiive liftA2 and <*>)
Line 2,321:
 
=={{header|Haskell}}==
<lang haskell>import DataSystem.ListRandom (unfoldrnewStdGen, randomRs)
import SystemControl.RandomApplicative (newStdGen, randomRsliftA2)
import ControlData.MonadList (liftM2, apunfoldr)
 
bnd :: String -> Char
Line 2,345:
lahmahgaan xs =
init .
until (liftM2liftA2 (==) last (last . init)) (ap (++) <*> (return . donxt . last)) $
[xs, donxt xs]
 
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.