.tieang1
Angle of a multicellular bot's first tie relative to the way the bot points (0 to 1256); writing it sets that angle.
Facts
- Address
- 480
- Name
.tieang1- Kind
- Input and output: both the bot and the engine write it
- Group
- Ties
- Written by
- Your DNA and the engine. Writing it with
store(or another two-operand store) sets the angle of the first tie in the movement phase; after that the engine writes the measured angle, which you read in the next cycle. - Cleared
- The engine rewrites it every cycle, only if you are multicellular, the first tie is stiffened and
.tienumor.tiepresis not 0. - Range
- 0 to 1256
- Mutations
- picked as a read (
*) and as a store target
It is a read-write cell for the bot's first tie (the oldest one it has left; if one breaks, the following ones shift up a slot), and it only works if the bot is multicellular (.multi) and that tie is stiffened.
Reading. Every cycle the engine publishes the direction of the partner as seen from the bot, on the scale of 1256 per full turn and always positive: 0 is straight ahead. It is the same angle as .tieang with the sign flipped and brought into the range 0 to 1256 (a .tieang of −300 is a .tieang1 of 300), and the same scale that .fixang uses. It is published before the bots are moved, so it can differ a little from the final angle of the cycle.
Writing. A value written with store (or with another two-operand store, such as addstore) sets that tie's angle, just like .fixang but without having to pick it with .tienum. Afterwards the engine writes the measurement back into the cell. Careful: inc, dec and the one-operand stores change the number but don't tell the tie (see Writing to memory).
If the bot isn't multicellular or the first tie isn't stiffened, the engine doesn't touch the cell. It doesn't touch it either if .tienum and .tiepres are both 0.
' make the first tie rotate around the bot
cond
*.multi 1 =
start
40 .tieang1 addstore
stopThe step has to exceed the 5-degree slack (about 17 on the 1256 scale) with which the engine holds the angle: with 10 .tieang1 addstore the tie doesn't move, because every cycle you ask for 10 more than what it measures and that difference falls within the slack.
The other three ties have .tieang2, .tieang3 and .tieang4; the length is handled with .tielen1.