.aimdx
Turns the bot to the right (clockwise) by the amount you write, on a scale where 1256 is a full turn.
Facts
- Address
- 5
- Names
.aimdx,.aimright- Kind
- Command: the bot writes it and the engine reads it and usually consumes it
- Group
- Movement
- Written by
- Your DNA.
- Read by
- The engine, in the movement phase of the same cycle. It is ignored if you wrote to
.setaima heading different from the current one. - Cleared
- The engine, in the movement phase of the same cycle, after turning.
- Range
- −32000 to 32000; 1256 is one full turn and a negative value turns left.
- Mutations
- picked as a store target
.aimdx turns the bot to its right. The number is the angle: 1256 is a full turn, 314 a quarter turn, and about 3.5 is one degree. On the screen the turn goes clockwise, so .aim goes down: a bot with .aim 160 that writes 100 .aimdx store ends up at 60.
The engine applies the turn in the same cycle, in the movement phase, and sets the cell back to 0. Its opposite is .aimsx: the engine turns by .aimsx − .aimdx, so a negative value turns left. The turn costs energy in proportion to the angle (see Execution and costs).
Since the push from .up is calculated with the heading from before the turn, a bot that turns and moves forward in the same cycle goes out with the old heading and only moves toward the new one in the next cycle.
' sweeps the surroundings, turning bit by bit while it sees nothing
cond
*.eye5 0 =
start
50 .aimdx store
stop