DarwinBotsManual
Open the app EspañolES

.tmemloc

Chooses which cell of the tied bot's memory gets copied into .tmemval.

Facts

Address
476
Name
.tmemloc
Kind
Command: the bot writes it and the engine reads it and usually consumes it
Group
Memory (memloc, memval and genetic)
Written by
Your DNA.
Read by
The engine, in the forces and collisions phase, when it fills .tmemval with the tied bot. It only uses addresses 1 to 1000.
Cleared
Nobody, not even when the tie is lost. A child is born with 0.
Range
−32000 to 32000; only 1 to 1000 are useful, with no range adjustment
Mutations
picked as a store target

It is the address the engine spies on in the tied bot to fill .tmemval. Like .memloc, it is a configuration sysvar: it is never cleared, not even when you lose the tie, so you only need to write it once. Only addresses 1 to 1000 are valid, with no range adjustment.

Besides recognizing species, it lets the cells of an organism read each other without spending channels: each one leaves its state in a cell of its own and the other one spies on it.

' Reproduces at 10 cycles and spies on cell 61 of the tied bot
cond
*.robage 10 =
start
50 .repro store
61 .tmemloc store
stop

' Everyone writes down their age in cell 61
cond
start
*.robage 61 store
stop

From the cycle after birth, the parent reads in .tmemval what its child wrote in cell 61 the cycle before: 0, 1, 2… The child, on the other hand, spies on nothing: it is born with .tmemloc at 0, because a newborn's memory starts empty. To send data instead of reading it, there are .tout1 and .tieloc.