Basic variables and operators pertaining to the robot's environment and general status are listed here.
The time (in frames) since the simulation began.
Vector: The size of the world.
The width of the world.
The height of the world.
Vector: The current position of this cell.
Vector: current velocity of this cell.
ID of this side
ID of this type
ID of this robot, unique within the side
ID of this robot's parent, or 0 if it was seeded
The number of instructions the processor can execute per frame.
Instructions remaining this frame.
Number of robots or walls this cell is currently touching.
Number of friendly robots this cell is currently touching.
Number of enemy robots this cell is currently touching.
Number of foods this cell is currently touching.
Number of shots this cell is currently touching.
Number of walls this cell is currently touching.
Variable visible to other robots, for communication.
Blows up the robot. Useful for missiles and maybe apoptosis.
value address --
Write value to address in shared memory. Addresses range from 1 to 1000.
address -- value
Read value from address in shared memory.
vector address --
Write vector to address and address + 1.
address -- vector
Read vector from address and address + 1.
channel -- n
Return the number of messages waiting on the given channel.
message length channel --
A message-passing style communications system. Each of the 10 channels contains a queue of up to 50 messages, each of which can be up to 8 values long. Typical use: food-position time 3 1 send.
channel -- message length
Length returned is zero if no message is available. Length 0 messages are prohibited to avoid confusion. The following code goes to the location specified in the message if the timestamp included in the message is recent. (This assumes that all messages on channel 1 are food-position / time pairs, length in this example is used only to decide if a message was received. Reliable code might want to check to see if the length is as expected): 1 receive if time 50 - > if seek-location else 2drop then then
Skips over (for this cell) all messages currently waiting on the given channel.