RosettaCodeData/Task/Elementary-cellular-automaton/Haskell/elementary-cellular-automaton-3.hs
2023-07-01 13:44:08 -04:00

4 lines
161 B
Haskell

displayCA n rule init = mapM_ putStrLn $ take n result
where result = fmap display . elems <$> runCA rule init
display 0 = ' '
display 1 = '*'