Created
October 18, 2017 19:40
-
-
Save SocraticPhoenix/e32e39c0de7230eacfbf2a69f29f7ca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
policy Ignore : all | |
model Tape : tape | |
model CharIo : io | |
token ">" { | |
tape.shiftPointer(1); | |
} | |
token "<" { | |
tape.shiftPointer(-1); | |
} | |
token "+" { | |
tape.set(tape.get() + 1); | |
} | |
token "-" { | |
tape.set(tape.get() - 1); | |
} | |
token "." { | |
tape.set((int) io.in()); | |
} | |
token "," { | |
io.out((char) tape.in()); | |
} | |
open "[" { | |
return tape.get() != 0; | |
} close "]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment