<numero> | Numbers and reads | A number written in the DNA, or the name of a sysvar without an asterisk, is pushed as is onto the integer stack. |
*<numero> | *.<sysvar> | Numbers and reads | An asterisk attached to a number or a sysvar pushes the contents of that memory cell: it's how you read the senses and your own variables. |
add | Basic | Adds the top two numbers of the integer stack and leaves the result. |
sub | Basic | Subtracts the top number of the stack from the one below it: a b sub leaves a − b. |
mult | Basic | Multiplies the top two numbers of the integer stack; if the product goes over 2 billion, it stays at that cap. |
div | Basic | Divides the lower number by the top one and rounds to the nearest integer (to the even one on a tie); dividing by zero gives 0. |
rnd | Basic | Replaces the top number of the stack with a random one between 0 and that number, both included. |
* | Basic | Reads memory at a computed address: pops an address from the stack and pushes what is in that cell. |
mod | Basic | Leaves the remainder of dividing the lower number by the upper one, with the sign of the dividend; with divisor 0 it gives 0. |
sgn | Basic | Replaces the top number of the stack with its sign: −1 if negative, 0 if zero and 1 if positive. |
abs | Basic | Replaces the number on top of the stack with its absolute value: it strips the sign. |
dup | Basic | Duplicates the number on top of the integer stack, to use it twice without reading or computing it again. |
drop | Basic | Pops the number on top of the integer stack and discards it. |
clear | Basic | Empties the integer stack in one go; it does not touch the boolean stack. |
swap | Basic | Swaps the top two numbers of the integer stack: a b swap leaves b a. |
over | Basic | Copies the second number of the integer stack to the top: a b over leaves a b a. |
angle | Advanced | Gives the angle from the bot to a point x y, in the same units as .aim: ready to store in .setaim. |
dist | Advanced | Gives the straight-line distance from the bot to a point x y. |
ceil | Advanced | Sets a ceiling: of the top two numbers on the stack it leaves the smaller, so x 100 ceil never goes above 100. |
floor | Advanced | Sets a floor: of the top two numbers on the stack it leaves the larger, so x 0 floor never goes below 0. |
sqr | Advanced | Replaces the top number of the stack with its rounded square root; if it isn't positive, it gives 0. |
pow | Advanced | Raises the lower number to the power of the upper one: 2 10 pow gives 1024. The exponent is limited to ±10. |
pyth | Advanced | Gives the hypotenuse of the top two numbers of the stack, the square root of a² + b²: the length of a vector. |
anglecmp | Advanced | Compares two angles and gives the shortest difference between them, signed, between −628 and 628: how much and which way to turn. |
root | Advanced | Gives the b-th root of the lower number: 27 3 root gives 3. It ignores signs and, with b at 0, gives 0. |
logx | Advanced | Gives the logarithm of the lower number in the base of the upper one, rounded: 1000 10 logx gives 3. |
sin | Advanced | Gives the sine of an angle in .aim units, multiplied by 32000: 314 sin gives 32000. |
cos | Advanced | Gives the cosine of an angle in .aim units, multiplied by 32000: 0 cos gives 32000. |
debugint | Advanced | Notes the number on top of the integer stack so you can look at it from the bot's console, without popping it and at no cost. |
debugbool | Advanced | Notes the value on top of the boolean stack so you can look at it from the bot's console, at no cost. |
~ | Bitwise | Inverts all the bits of the number on top: x ~ leaves −x − 1, so 5 ~ gives −6 and 0 ~ gives −1. |
& | Bitwise | Bitwise and of the top two numbers: keeps only the bits that are set in both. Good for checking and clearing flags. |
| | Bitwise | Bitwise or of the top two numbers: leaves set every bit that is set in either one. Good for setting flags. |
^ | Bitwise | Bitwise exclusive or of the top two numbers: leaves a number whose set bits are those in only one of the two. Good for flipping flags. |
++ | Bitwise | Adds 1 to the number on top of the integer stack, without touching memory: 5 ++ leaves 6. |
-- | Bitwise | Subtracts 1 from the number on top of the integer stack, without touching memory: 5 -- leaves 4 and 0 -- leaves −1. |
- | Bitwise | A loose minus sign flips the sign of the top number: 5 - leaves −5. It doesn't subtract; for that there is sub. |
<< | Bitwise | Shifts the bits of the top number one place to the left, that is, multiplies it by 2: 5 << leaves 10. |
>> | Bitwise | Shifts the bits of the top number one place to the right, keeping the sign: it divides by 2 rounding down, so 7 >> leaves 3 and −5 >> leaves −3. |
< | Comparisons | a b < leaves true if a is less than b. The comparison for “hasn't reached yet”. |
> | Comparisons | a b > leaves true if a is greater than b. The one in *.eye5 0 >, “I see something”. |
= | Comparisons | a b = leaves true if the two numbers are equal. The one in *.eye5 0 =, “I see nothing”. |
!= | Comparisons | a b != leaves true if the two numbers are different. The one in *.refeye *.myeye !=, “it is not one of mine”. |
%= | Comparisons | a b %= leaves true if b is within 10% of a, limits included. With a negative a it is always false. |
!%= | Comparisons | a b !%= leaves true if b strays more than 10% from a. It is the exact negation of %=, so with negative a it is always true. |
~= | Comparisons | a b d ~= leaves true if b is within d % of a: an “about equal” with the margin you choose. Pops three numbers. |
!~= | Comparisons | a b d !~= leaves true if b strays more than d % from a. It is the negation of ~= and also pops three numbers. |
>= | Comparisons | a b >= leaves true if a is greater than or equal to b: like >, but the limit counts too. |
<= | Comparisons | a b <= leaves true if a is less than or equal to b: like <, but the limit counts too. |
and | Logic | Replaces the top two values of the boolean stack with one: true only if both are. |
or | Logic | Replaces the top two values of the boolean stack with one: true if either is. The only way to ask for “this or that”. |
xor | Logic | Replaces the top two values of the boolean stack with one: true if exactly one of the two is. |
not | Logic | Inverts the top value of the boolean stack: true becomes false and false becomes true. On an empty stack it gives false. |
true | Logic | Pushes a true onto the boolean stack. Inside a gene's body, it re-enables the stores that a condition had blocked. |
false | Logic | Pushes a false onto the boolean stack. In a gene's condition it turns it off; in the body it blocks the stores that follow. |
dropbool | Logic | Pops and discards the value on top of the boolean stack. Inside the body, it ends the effect of an inline condition. |
clearbool | Logic | Empties the boolean stack. Since empty counts as true, every store that follows writes again. |
dupbool | Logic | Duplicates the value on top of the boolean stack. Good for saving a condition and using it again, for example to nest conditions in the body. |
swapbool | Logic | Swaps the top two values of the boolean stack. It lets you compute two conditions and choose which one rules each stretch of the body. |
overbool | Logic | Pushes a copy of the second value of the boolean stack: a b becomes a b a. With a single value it pushes true. |
store | Writing to memory | Stores a number at a memory address: it's how every command is given, like 20 .up store to move forward. |
inc | Writing to memory | Adds 1 to a memory cell: the cheapest counter in the DNA. |
dec | Writing to memory | Subtracts 1 from a memory cell: the cheap way to keep a countdown. |
addstore | Writing to memory | Adds a number to what is already in a cell, without having to read it first. |
substore | Writing to memory | Subtracts a number from what's already in a cell: the cell minus the value. |
multstore | Writing to memory | Multiplies what's in a cell by a number and stores the result right there. |
divstore | Writing to memory | Divides what is in a cell by a number, rounding to the nearest integer; dividing by 0 leaves the cell at 0. |
ceilstore | Writing to memory | Puts a ceiling on a cell: if what it holds is greater than the number, it lowers it to that number. |
floorstore | Writing to memory | Puts a floor under a cell: if what it holds is smaller than the number, it raises it to that number. |
rndstore | Writing to memory | Replaces what's in a cell with a random number between 0 and that value, with the same sign. |
sgnstore | Writing to memory | Replaces what's in a cell with its sign: −1 if negative, 0 if zero, 1 if positive. |
absstore | Writing to memory | Strips the sign from what is in a cell: a negative becomes positive. |
sqrstore | Writing to memory | Replaces what's in a cell with its rounded square root; if it isn't positive, it leaves it at 0. |
negstore | Writing to memory | Flips the sign of what's in a cell: 20 becomes −20 and −20 becomes 20. |
cond | Flow | Opens a new gene: empties the boolean stack and starts the condition section, which ends at start or else. |
start | Flow | 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. |
else | Flow | Opens the alternative body of a gene, which runs when the conditions of the cond came out false. |
stop | Flow | Closes the gene: whatever follows, up to the next marker, is not executed. |
end | Flow | Ends the DNA: whatever comes after it does not run. The engine adds one at the end if you do not. |