start
Closes the gene's conditions and opens its body, which runs if all of them came out true; with no cond before it, it always runs.
Facts
- Word
start- Family
- Flow
- What it does
- Opens the body of the gene. After a
cond, it empties the boolean stack and runs only if all the conditions are true (or there are none). With no cond before it, it opens a gene without conditions. - Cost
- Flow control; end is free
- Runs
- always
start opens the gene's body: the part where stores do write. What happens when it's reached depends on what comes before:
- After a
cond, it does an and of everything left on the boolean stack and leaves it empty. If everything was true (or there was nothing), the body runs; if not, it is skipped up to the next marker. - With no
condbefore it (at the start of the DNA, after astopor after another body), it opens a new gene with no conditions, which always runs.
' the first gene always runs; the second, only for the first 20 cycles of life
start
10 .up store
stop
cond
*.robage 20 <
start
30 .aimdx store
stopThe bot moves forward all the time with .up and turns with .aimdx until cycle 20. After that .robage reaches 20 and the second body stops running.
Two traps:
- A second
startin a row is not an “and also”: it opens another gene with no conditions. If you want two bodies with the same condition, repeat thecond. - A
startwith noconddoesn't empty the boolean stack. If the previous gene left a false on top with an inline condition, that false keeps blocking the stores (seestopand The integer and boolean stacks).cond startis safer.
Inside the body, a new condition governs the stores that come after it; that is covered in Inline conditions. The rest of the gene is in Genes: cond, start, else and stop.