Position and surroundings
Where the bot is in the world, whether it touches the edge, whether it is day and how many bots there are: the senses that locate it.
| Address | Sysvar | Kind | Summary |
|---|---|---|---|
| 214 | .edge | Sense | It is 1 when the bot is resting against the edge of the world; use it to avoid getting stuck to the wall. |
| 217 | .depth .ypos | Sense | The bot's vertical position: 0 at the top edge, growing downward, like a depth. |
| 218 | .daytime | Sense | It is 1 if it's daytime and 0 if it's night; for a bot with chloroplasts, 1 only if the sun is also shining on it. |
| 219 | .xpos | Sense | The bot's horizontal position in the world: 0 at the left edge and growing toward the right. |
| 400 | .sun | Sense | It is 1 when the bot points toward the top of the screen (with about 10 degrees of margin); it has nothing to do with light. |
| 401 | .totalbots | Sense | How many bots there are in the whole world, counting vegetables, other species and corpses. |
| 402 | .totalmyspecies | Sense | How many living bots there are of your own species, including the one reading it. |
These sysvars tell the bot where it is standing and what the world around it is like. The engine writes all of them; writing to them is pointless, because the engine publishes them again every cycle. And since it publishes them after the DNA runs, in the first cycle of life they are 0.
- Where it is.
.xposand.depth(also.ypos) are its coordinates: the horizontal and the vertical, with 0 at the top left and depth growing downward. - The edge.
.edgeis 1 when the bot is leaning against the edge of the world. - The light.
.daytimesays whether it is day (or, for a bot with chloroplasts, whether the sun is shining on it)..sun, despite its name, has nothing to do with light: it is 1 when the bot points upward. - The population.
.totalbotscounts all the bots in the world and.totalmyspeciesthose of its own species.
The most used are .edge, to avoid getting stuck against the wall, and .totalmyspecies, to regulate reproduction: no more children once the species has filled the world. This bot only reproduces while its species has fewer than 50 members:
cond
*.totalmyspecies 50 <
*.nrg 5000 >
start
50 .repro store
stopPosition is useful for staying in a zone (for example, the lit part of a pond, see Chloroplasts and vegetables) or, together with .refxpos and .refypos, for working out which way what it sees is.