.rdboy
The bot's buoyancy, from 0 to 32000, as it was left the last time it changed it with .setboy.
Facts
- Address
- 315
- Name
.rdboy- Kind
- Sense: the engine writes it for the DNA to read
- Group
- Body, energy and state
- Written by
- The engine, in the actions phase, only in the cycles where
.setboyis not 0. You read it in the next cycle. - Cleared
- No: it keeps the last value until the next
.setboy. - Range
- 0 to 32000: the buoyancy from 0 to 1.
- Note
- A child inherits the parent's buoyancy, but reads 0 until it writes
.setboyfor the first time. - Mutations
- picked as a read (
*)
It shows the bot's buoyancy on the 0 to 32000 scale (32000 is the maximum). What buoyancy does is explained in .setboy.
The catch is that the engine only updates it in the cycles when the bot writes .setboy with something other than 0. The rest of the time it keeps the last value, or whatever you wrote yourself into the cell. And a child is born with its parent's buoyancy but with .rdboy at 0, because memory isn't inherited: until it touches .setboy for the first time, it will read 0 even though it is floating.
One way to sync it at birth is to send a change that is null in practice: a .setboy of 1 moves the buoyancy by just 1/32000 and forces the engine to publish it.
' At birth, ask for its real buoyancy to be published
cond
*.robage 0 =
start
1 .setboy store
stop