DarwinBotsManual
Open the app EspañolES

>

a b > leaves true if a is greater than b. The one in *.eye5 0 >, “I see something”.

Facts

Word
>
Family
Comparisons
Integer stack
pops 2, pushes 0
Boolean stack
pops 0, pushes 1
What it does
Pops two numbers a b and pushes true if a, the lower one on the stack, is greater than b. With an empty stack it gives false.
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 a (the lower one) is greater than b (the upper one). 5 3 > is true; 3 5 > and 5 5 > are false.

It is one of the most frequently written comparisons in the DNA, thanks to one phrase: *.eye5 0 >, “the middle eye sees something” (.eye5 is 0 when there is nothing in sight). It is also the one for thresholds: “if I have more than this much energy”. This bot moves forward (.up) only while it has more than 1000 energy (.nrg):

' moves forward while it has more than 1000 energy
cond
  *.nrg 1000 >
start
  10 .up store
stop

Watch the order: 1000 *.nrg > asks the opposite, whether 1000 is greater than the energy. If the limit has to count too, use >=. The exact opposite of a b > is a b <= (<=).

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