Solves the Tower of Hanoi puzzle for odd numbers of disks. Input the number of disks (default 1) and seconds to wait between operations of the Turing machine (default 0). If the number of disks is even, it is automatically increased by 1. Warning: Even with no delay, each operation can take up to 1/2 second on slower computers, and the least number of moves required to solve the puzzle for n disks is 2^n -1. The number of operations will be higher due to the algorithm used to solve the puzzle. In short, don't enter more than 9 for the number of disks unless you have 10 minutes to spare.
The solution is found by a 5-state Turing machine. In each state, the machine can optionally check the current carried disk against the disk on the pole in front of it, take or drop a disk, and move left or right, in that order. The machine then progresses to a different state. If the machine attempts to take a disk from an empty pole, it will imagine it is holding a disk bigger than any valid disk in play. When dropped, this imaginary disk vanishes. If the machine moves left or right off the edge of the screen, it wraps around to the opposite side. Inspect the code for the state table.