RosettaCodeData/Task/Langtons-ant/Haskell/langtons-ant-5.hs

6 lines
162 B
Haskell
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
task :: State -> State
task = iterate step
>>> dropWhile ((< 50) . distance . antPosition)
>>> getCells . head
where distance (x,y) = max (abs x) (abs y)