You can simulate a one-way finite state machine using this same system, by setting the third element of all tuples to /R or /L appropriately
- Begin by initializing the machine.
- Request more than the amount of tape length required. You have to start over if the head moves outside the tape.
- Enter the starting position of the read/write head on the tape. The head should be within the tape.
- Optionally enter the intial contents of the tape. Enter a string the same length as the tape and use underscore for blank space. For example: initializing the tape of length 5 with red starting at position 3 should be __red. Leaving this field blank creates a blank tape.
- Enter the tuples that define the machine, one in each line, in the following format - current_state,read,write/move,next_state. States can only be numeric. The difference between write and move is as follows:
- /R or /r causes the tape head to move right.
- /L and /l causes the tape head to move left.
- All other characters are written to the tape.
- Enter a value for the initial state of the machine.
- Click "Initialize Machine".
- If all values entered were valid, the machine will appear on the right pane.
- Enter a value for the number of steps to simulate the machine and click on "Step Machine".
- Updating/editing the tuples at any point will be reflected the next time the machine is stepped.
- Enter a new tape length and head starting position and click "Initialize Machine" to start over.
- NOTE: If you have the tuples format correct and still get an error message, check if there is an empty line at the end
Quick exercise: Add another tuple to this list such that the machine does not give an error at the end of the task, but instead stays in a particular state indefinitely.
- Set tape length to 10 and head position to 1. No initial contents.
- Enter the following tuples
- Enter initial state as 0
- Click "Initialize Machine"
- Enter number of steps as 1
- Keep clicking "Step Machine" until machine completes writing the string and halts.