.eye5dir
Turns eye 5 relative to its factory position (straight ahead): positive toward the left, negative toward the right; 1256 is a full turn.
Facts
- Address
- 525
- Name
.eye5dir- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Eyes
- Written by
- Your DNA.
- Read by
- The engine, in the actions phase of every cycle, when it fills
.eye5. - Cleared
- Never: it stays as you left it.
- Range
- −32000 to 32000; only the remainder of dividing by 1256 counts, which is one full turn.
- Mutations
- picked as a store target
Shifts the direction of .eye5, which in the factory configuration looks straight ahead along .aim. It is measured in the same units as .aim: a full turn is 1256, a half turn 628 and 10 degrees about 35. Positive values move the eye to the left and negative ones to the right. The eye stays attached to the bot: if the bot turns, the eye turns with it.
It is configuration: the engine reads it every cycle but never clears it, so writing it once is enough. Only the remainder of dividing by 1256 counts, with its sign: 1256 is equivalent to 0 and 1300 to 44. The change shows in what the eye sees from the next cycle on.
This bot turns the front eye around so that it looks backward (628 is a half turn). Since .eye5 is also the factory focus eye, the cells in what it sees now describe what is behind the bot:
cond
*.robage 0 =
start
628 .eye5dir store
stopTo change how much the eye covers, use .eye5width. The other eyes and how they are laid out are covered in Eyes.