.fixlen
Command that fixes the natural length of a stiffened tie, measured edge to edge between the two bots.
Facts
- Address
- 469
- Name
.fixlen- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Ties
- Written by
- Your DNA.
- Read by
- The engine, in the movement phase: the chosen tie takes that natural length, edge to edge and unsigned, at both ends. Only stiffened ties.
- Cleared
- The engine, after using it; the new length stays. If you have no ties, or
.tienumand.tiepresare 0, it stays written. - Range
- −32000 to 32000; it is taken unsigned and 0 does nothing
- Mutations
- picked as a store target
Changes the rest length of the tie chosen with .tienum (or the one in .tiepres). The number is the edge-to-edge distance you want between the two bots; it is taken without sign and applies to both ends. From then on the tie acts like a spring that pushes or pulls toward that length; it tolerates about 20 units of difference without exerting force, so the bots usually end up oscillating around the value.
It only acts on stiffened ties of a multicellular bot (.multi). The engine sets it back to 0 after using it, but the new length stays: writing it once is enough. If the bot has no ties, the value stays written.
A very large length does not stretch the tie without limit: if the bots drift more than 1000 apart edge to edge, the tie breaks. Snap Tie bot, from the Bestiary, uses exactly that to move: it asks for a length of 10000 and the tie snaps.
' once multicellular, move 150 away from the partner
cond
*.multi 1 =
start
150 .fixlen store
stop.tielen shows the actual length in every cycle.