# subst.tur: classical example of the substraction of two numbers. # # Tape format: "0111..1101...10" where the number of 1's in the first set # is the minuend and the number of 1's in the second set is the substractor. # 0 0 0 r 1 Mover hacia la derecha hasta encontrar el cero central. 1 1 1 r 1 1 0 0 r 2 El cero central: comenzamos a restar. 2 0 0 r 2 Mover hacia la derecha mientras hayan ceros. 2 1 0 l 3 Si encontramos un uno, lo substituimos por un cero y 3 0 0 l 3 nos movemos hacia la izquierda hasta 3 1 0 r 2 encontrar un uno, ponerlo a cero y regresar al estado 2.