home *** CD-ROM | disk | FTP | other *** search
- # TM to double a unary number
- #move to start of initial number
- 0,0->0,0,R
- 0,1->1,0,R
- #cycle right through rest of init num
- 1,1->1,1,R
- 1,0->2,0,R
- #cycle right through partial answer
- 2,1->2,1,R
- 2,0->3,1,R
- #add second mark
- 3,0->4,1,L
- 3,1->4,1,L
- #cycle left through partial answer
- 4,1->4,1,L
- 4,0->5,0,L
- #is there anything remaining of first number
- 5,0->7,0,R
- 5,1->6,1,L
- #cycle left through initial number
- 6,0->0,0,R
- 6,1->6,1,L
- #cycle right and stop
- 7,0->8,0,R
- 7,1->8,0,R
- #loop righ and stop
- 8,1->8,1,R
- 8,0->8,0,S