DarwinBotsManual
Open the app EspañolES

overbool

Pushes a copy of the second value of the boolean stack: a b becomes a b a. With a single value it pushes true.

Facts

Word
overbool
Family
Logic
Boolean stack
pops 2, pushes 3
What it does
Copies the second of the boolean stack to the top: a b becomes a b a. With a single value it pushes true; with an empty stack it does nothing.
Cost
Logic
Runs
inside a gene: in the condition (cond) and in the body (start or else)

overbool copies the value that is second from the top of the boolean stack and puts it on top: a b becomes a b a. It's useful for combining two conditions without losing either:

cond
start
  *.robage 3 >
  *.robage 6 <
  overbool and
  50 inc
  dropbool
  51 inc
  clearbool
stop
AfterBoolean stack (top on the right)
the two comparisonsgreater than 3, less than 6
overboolgreater than 3, less than 6, greater than 3
andgreater than 3, (less than 6 and greater than 3)
dropboolgreater than 3

Cell 50 counts the cycles with age (.robage) 4 or 5, and cell 51 all those with age greater than 3: after 10 cycles they hold 2 and 6.

To have two copies of the top one there is dupbool.