Simulation of a Turing Machine - Etude #13 from Charles Wetherell's "Etudes for Programmers"