home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pyth_os2.zip / python-1.0.2 / Demo / turing / double.tm < prev    next >
Text File  |  1994-03-02  |  392b  |  21 lines

  1. ; This turing machine doubles its input.  Useful to check that dynamic
  2. ; strings work.  On output, the tape head will point to the result.
  3. ;
  4.  
  5. <1, 'a'> --> <1, '#'>
  6. <1, '#'> --> <2, R>
  7. <1, ' '> --> <0, R>
  8.  
  9. <2, 'a'> --> <2, R>
  10. <2, ' '> --> <3, R>
  11.  
  12. <3, 'a'> --> <3, R>
  13. <3, ' '> --> <4, 'a'>
  14.  
  15. <4, 'a'> --> <4, R>
  16. <4, ' '> --> <5, 'a'>
  17.  
  18. <5, 'a'> --> <5, L>
  19. <5, ' '> --> <5, L>
  20. <5, '#'> --> <1, R>
  21.