home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / EDUCATIO / TURING10.ZIP / DOUBLE < prev    next >
Encoding:
Text File  |  1991-12-28  |  536 b   |  28 lines

  1. # TM to double a unary number
  2. #move to start of initial number
  3. 0,0->0,0,R
  4. 0,1->1,0,R
  5. #cycle right through rest of init num
  6. 1,1->1,1,R
  7. 1,0->2,0,R
  8. #cycle right through partial answer
  9. 2,1->2,1,R
  10. 2,0->3,1,R
  11. #add second mark
  12. 3,0->4,1,L
  13. 3,1->4,1,L
  14. #cycle left through partial answer
  15. 4,1->4,1,L
  16. 4,0->5,0,L
  17. #is there anything remaining of first number
  18. 5,0->7,0,R
  19. 5,1->6,1,L
  20. #cycle left through initial number
  21. 6,0->0,0,R
  22. 6,1->6,1,L
  23. #cycle right and stop
  24. 7,0->8,0,R
  25. 7,1->8,0,R
  26. #loop righ and stop
  27. 8,1->8,1,R
  28. 8,0->8,0,S