home *** CD-ROM | disk | FTP | other *** search
- # this implements Euclid's Greatest Common Denominator
- # it is from the book "The Emperor's New Mind"
- #
- # usage: start the machine to the left of two unary
- # numbers seperated by a space
- #
- 0,0->0,0,R
- 0,1->1,1,L
- 1,0->2,1,R
- 1,1->1,1,L
- 2,0->10,0,R
- 2,1->3,0,R
- 3,0->4,0,R
- 3,1->3,1,R
- 4,0->4,0,R
- 4,1->5,0,R
- 5,0->7,0,L
- 5,1->6,1,L
- 6,0->6,0,L
- 6,1->1,1,L
- 7,0->7,0,L
- 7,1->8,1,L
- 8,0->9,0,L
- 8,1->8,1,L
- 9,0->2,0,R
- 9,1->1,1,L
- 10,0->0,0,S
- 10,1->10,1,R