DarwinBotsManual
Open the app EspañolES

=

a b = leaves true if the two numbers are equal. The one in *.eye5 0 =, “I see nothing”.

Facts

Word
=
Family
Comparisons
Integer stack
pops 2, pushes 0
Boolean stack
pops 0, pushes 1
What it does
Pops two numbers and pushes true if they are equal. With an empty stack it compares 0 with 0 and gives true.
Cost
Condition
Runs
inside a gene: in the condition (cond) and in the body (start or else)

a b = pops two numbers and pushes true if they are equal and false if not. Here the order doesn't matter: 3 3 = is true and 3 4 = is false.

Two classic uses:

This bot turns right (.aimdx) while it sees nothing, looking for something to look at:

' turns while it sees nothing
cond
  *.eye5 0 =
start
  60 .aimdx store
stop

To compare values that wobble a little, such as a speed or a distance, an exact = is usually too strict; in those cases %= and ~= are useful. The opposite of = is !=.

With the integer stack empty it compares 0 with 0 and gives true. The other comparisons are in Comparisons.