.robage
The bot's age in cycles: 0 in its first cycle of life, it goes up by 1 and stops at 32000.
Facts
- Address
- 9
- Name
.robage- Kind
- Sense: the engine writes it for the DNA to read
- Group
- Body, energy and state
- Written by
- The engine, in the actions phase: the bot's age. It overwrites whatever you write. You read it in the next cycle.
- Cleared
- No: the engine rewrites it every cycle.
- Range
- 0 to 32000: 0 in the first cycle of life; on reaching 32000 it stays there.
- Mutations
- picked as a read (
*)
It counts how many cycles the bot has been alive. The engine publishes it at the end of every cycle, so in the first cycle of life the DNA reads 0, in the second 1, and so on. It is the same for a freshly loaded bot as for a newborn child. On reaching 32000 it stays there: it doesn't start over.
The most common use is to do something just once, at birth:
' At birth, just once, it does a half turn
cond
*.robage 0 =
start
628 .aimdx store
stopThis bot turns 628 (a half turn) in its first cycle and never turns again after that. It is also useful for waiting before reproducing (*.robage 10 >) or for giving a child a few cycles of grace.
You can't change it: if you write to .robage, the engine overwrites your value in the same cycle (see Writing to memory). If you need a clock that you can reset to zero, or that parent and child keep sharing, use .timer. The age of what you are looking at is in .refage.