Universal Turing Machines, Part 6: Headbashing
Ok, so we just finished simulating a write, now it’s time to simulate movement of the head to the Left or Right one square.
This routine should be fairly straightforward.
- Scan back to the symbol in the transition table and read the L or R.
- Scan forward to the marked symbol on the tape.
- If we are moving to the Right, then sail past and mark the next s, unless we hit a blank, in which case we’re done (because that will be picked up by the Copy Blank Subroutine the next time through the simulation).
- If we are moving to the Left, then back up and mark the previous s, unless we run of the left end of the Tape, in which case the head is forced to stay on the leftmost square.