Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Write your Turing machine program here!
- ; Syntax: <current state> <current symbol> <new symbol> <direction> <new state>
- ; ';' starts a comment.
- ; '*' is a wildcard: it matches any symbol/state when used in the current symbol/state field;
- ; it means 'same as current' when used in new symbol/new state field.
- ; '_' represents the blank (space) symbol.
- ; Symbols must be a single non-whitespace character except ';'.
- ; States can be any word, not only numbers.
- ;
- ; This example program concatenates the first string of '1's to the end of the second.
- 0 * * * zstart
- zstart 0 0 r z0
- zstart 1 1 r z1
- z0 0 0 * z0
- z0 1 1 * z0
- z0 _ _ l halt
- z1 0 0 r z1
- z1 1 1 r z1
- z1 _ _ l z2
- z2 0 _ l z3
- z2 1 1 * z2
- z3 0 _ l zreset
- z3 1 1 * z3
- zreset 0 0 l zreset
- zreset 1 1 l zreset
- zreset _ _ r halt
- ; This is a hack to load an appropriate initial tape. $INITIAL_TAPE: 11110011111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement