Execute Brain****/Haskell: Difference between revisions

m
no edit summary
(i don't think minus stops at 0)
mNo edit summary
Line 32:
exec p@(_,'>':_) d cs = exec (moveRight p) (pad $ moveRight $ d) cs
exec p@(_,'<':_) d cs = exec (moveRight p) (pad $ moveLeft $ d) cs
exec p@(_,'+':_) d cs = exec (moveRight p) (modify (+ 1) d) cs
exec p@(_,'-':_) d cs = exec (moveRight p) (modify (- 1) d) cs
exec p@(_,',':_) d (c:cs) = exec (moveRight p) (modify (const c) d) cs
Anonymous user