I am trying to write a set of rules that copies a set of ticks, however long one space next to the original set, I have a loop which does so, however it does not stop and continues ahead and breaks the copied items.
http://i.imgur.com/8cpaYkN.png
under the cut off of the picture it should say 5 0 -> 1 Tick
This is based on the model found at: http://en.wikipedia.org/wiki/Turing_machine_examples#A_copy_subroutine
Any insight?
edit: it should halt when it reaches the middle zero between the two series of numbers, but mine keeps going.
edit:
So my program checks for a 1, if it finds it it turns it to a zero and skips the following ones until it reaches a zero, it skips the zero and the following ones (which there are none of at the start) and changes the first 0 to a 1, it then returns by skipping the ones and the zero, and then skipping the ones till it finds the first zero (the one that was changed) changes it to a one and then the program loops. It should stop when it reaches the centre zero that separates the two numbers.
It is like this.
State 1, 0 -> state 1, 0
State 1, 1 -> state 2, 1 [changes the first 1 to a 0]
state 2, 1 -> state 2, 1
state 2, 0 -> state 3, 0
state 3, 1 -> state 3, 1
state 3, 0 -> state 4, 1 (right) (goes back) [changes the first 0 to a 1]
state 4, 1 -> state 4, 1 (right)
state 4, 0 -> state 5, 0 (right)
state 5, 1 -> state 5, 1 (right)
state 5, 0 -> state 1, 1 (left) (loops) [changes the first changed 1 back]
If I do this for any sequence of ones, it will copy them, however, it will not stop the loop, and it will continue after it is finished and break the copy.
So if I input:
0 0 1 1 1 0 0 0 0 0 0.....
the rules will do the following:
0 0 1 1 1 0 0 0 0 0 0.....
0 0 0 1 1 0 1 0 0 0 0.....
0 0 1 0 1 0 1 1 0 0 0.....
0 0 1 1 0 0 1 1 1 0 0.....
0 0 1 1 1 0 1 1 1 0 0.....
(it is now supposed to stop but it keeps going, testing the new copied inputs.)