FANDOM


A processor is the hardware component that almost every robot possesses, allowing it to execute instructions. A robot without a processor can't do anything, not even reproduce.

Optionally, a processor may also equipped with local memory for local data storage.

Language ReferenceEdit

Basic variables and operators pertaining to the robot's environment and general status are listed here.

Variable Meaning
time
The time (in frames) since the simulation began.
world-size
Vector: The size of the world.
world-width
The width of the world.
world-height
The height of the world.
position
Vector: The current position of this cell.
velocity
Vector: current velocity of this cell.
radius
mass
speed
side
ID of this side
type
ID of this type
id
ID of this robot, unique within the side
parent-id
ID of this robot's parent, or 0 if it was seeded
processor
The number of instructions the processor can execute per frame.
remaining
Instructions remaining this frame.
collision
Number of robots or walls this cell is currently touching.
friendly-collision
Number of friendly robots this cell is currently touching.
enemy-collision
Number of enemy robots this cell is currently touching.
food-collision
Number of foods this cell is currently touching.
shot-collision
Number of shots this cell is currently touching.
wall-collision
Number of walls this cell is currently touching.
flag
Variable visible to other robots, for communication.
Operator Stack Diagram Comments
die
-- Blows up the robot. Useful for missiles and maybe apoptosis.
write
value address -- Write value to address in shared memory. Addresses range from 1 to 1000.
read
address -- value Read value from address in shared memory.
vwrite
vector address -- Write vector to address and address + 1.
vread
address -- vector Read vector from address and address + 1.
messages
channel -- n Return the number of messages waiting on the given channel.
send
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.
receive
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
clear-messages
channel -- Skips over (for this cell) all messages currently waiting on the given channel.
skip-messages
n channel -- Skips over up to n messages.
type-population
type-id -- n return the number of cells of the given type.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.