Skip to content

Instantly share code, notes, and snippets.

@SocraticPhoenix
Created October 18, 2017 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SocraticPhoenix/e32e39c0de7230eacfbf2a69f29f7ca9 to your computer and use it in GitHub Desktop.
Save SocraticPhoenix/e32e39c0de7230eacfbf2a69f29f7ca9 to your computer and use it in GitHub Desktop.
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