DarwinBotsManual
Open the app EspañolES

not

Inverts the top value of the boolean stack: true becomes false and false becomes true. On an empty stack it gives false.

Facts

Word
not
Family
Logic
Boolean stack
pops 1, pushes 1
What it does
Inverts the top of the boolean stack. With an empty stack it pushes false, because an empty stack counts as true.
Cost
Logic
Runs
inside a gene: in the condition (cond) and in the body (start or else)

not pops the top value of the boolean stack and pushes the opposite.

In the condition section it's useful for negating a whole combination. This gene makes the bot turn (.aimdx) when it is not seeing anything (.eye5) and is not newly born (.robage): the not negates the result of the or:

' turns if it sees nothing and is no longer newly born
cond
  *.eye5 0 >
  *.robage 5 <
  or
  not
start
  50 .aimdx store
stop

Inside the body it gives an “otherwise”: after a group of stores that depend on a condition, not inverts it and the stores that follow run in the opposite case. The example is in Logic and in Inline conditions.

To negate a single comparison, it is usually clearer to use the opposite one: a b < instead of a b >= not (see <). To invert the bits of a number there is ~, which is something else.