A below includes instructions 1-3, B 4-6, C 7-8, and D 9-10
A (1-3): print 0, move left, move left until 0 found
B (4-6): print 1, move right, move right until 0 found
C (7-8): print 1, move right
D (9-10): if 1 found start over, otherwise stop.
0 0 0 0 1 1 1 0 0 0 start
|
0 0 0 0 0 1 1 0 0 0 result of A
|
0 0 0 1 0 1 1 0 0 0 result of B
|
0 0 0 1 1 1 1 0 0 0 result of C, D: 1 found so start over
|
0 0 0 1 1 0 1 0 0 0 result of A
|
0 0 1 1 1 0 1 0 0 0 result of B
|
0 0 1 1 1 1 1 0 0 0 result of C, D: 1 found so start over
|
0 0 1 1 1 1 0 0 0 0 result of A
|
0 1 1 1 1 1 0 0 0 0 result of B
|
0 1 1 1 1 1 1 0 0 0 result of C, D: 0 found, so stop
|