TM · Recursively enumerable
Reverse a string
Take the last symbol of w, erase it, and write it after a # at the far end; repeat until w is gone, then remove the #. The first symbol is marked at the start (A or B) so the machine can tell when it is copying the last one — a one-way tape has no other way to know where its left end is.
The author’s examples, run
ε → acceptaabba → accepta → acceptaaaaaabba → accept
Behaviour
Halts from a blank tape after 1 steps, leaving 0 non-blank cells.