For my demonstration, I used an Animal_Minimalis slightly modified to have a search pattern in wide irregular circles.
If for the first gene, I use
cond
0 1 =
start
10 .up store
else
10 .up store
stop
bots stay put while turning when they see nothing instead of describing wide circles. However, the code should be correct because replacing the condition with '0 0 =' yields expected behaviour.
To get the else block to execute properly, I need to write:
cond
0 1 =
start
10 .up
else
10 .up
stop
cond
start
store
Obviously, the problem comes from store instructions not being executed inside the 'else'-block.
Solution: in Private Sub ExecuteDNA(n As Integer), replace the second line of
Case 7 'store, inc and dec
If CurrentFlow = body Then
by If CurrentFlow = body Or CurrentFlow = ELSEBODY Then