finite state machine tool
Enter a turing machine in the box below by defining its transitions. It uses ha as halt-accept state, hr as halt-reject state, and S as start state. It uses _ for blank symbols. Output will only look nice if symbols are one character big. Each transition is a 5-tuple in the following notation:
state, symbol -> newstate, newsymbol, move-direction
where move-direction is l for left, r for right, and s for stay. The rule given by:
2,a -> hr,b,s
means if you are in state 2 and see the symbol a on the tape, move to the halt-reject state, write a b, and stay in place. An example machine:
S,_ -> FE,!,r
FE,_ -> RW,_,l
FE,* -> FE,_,r
RW,! -> H,h,r
RW,_ -> RW,_,l
H,* -> E,e,r
E,* -> L,l,r
L,* -> LL,l,r
LL,* -> ha,o,r

You do not need to define all moves for the machine, but if there is no available move (or if it moves all the left side of the tape), then it crashes. Note that the asterix (*) is a wildcard character that matches any symbol. Rules are processed in order from top to bottom, therefore if there is a rule for S,a and later S,*, then the * will match all characters except a. If S,* comes first, then no other S rule will be matched. A wildcard character can appear in the right as what to write, in which case whatever was on the tape will remain. This machine starts on a blank cell to the left of the initial word on the tape.
turing machine description
input tape (assumes initial blank cell then word)