.refaim
Which way the bot you are looking at is pointing, on the same scale as .aim: for knowing whether it is looking at you.
Facts
- Address
- 711
- Name
.refaim- Kind
- Sense: the engine writes it for the DNA to read
- Group
- What it sees (ref*)
- Written by
- The engine, in the actions phase of every cycle, with the heading (
.aim) of the bot your focus eye sees. Also on colliding with a bot. You read it in the next cycle. - Cleared
- The engine, every cycle, when the senses are cleared.
- Range
- Almost always 0 to 1255 (a full turn is 1256); while the other bot is turning it can overshoot a little.
- Mutations
- picked as a read (
*)
.refaim is the direction the bot your focus eye sees is pointing: what that bot reads in its .aim. A full turn is 1256; it is almost always between 0 and 1255, although while turning it can overshoot a little.
The most useful thing is to compare it with your own heading. If the other bot is looking at you, its heading is yours turned around, that is, yours plus 628. The operator anglecmp gives the difference between two angles taking the full turn into account:
' is it looking at me? then I sidestep
cond
*.eye5 0 >
*.refaim *.aim 628 add anglecmp abs 60 <
start
50 .sx store
stopWith two bots that were turning until they saw each other, the condition was met just as they ended up face to face. A bot that is looking at you is probably about to shoot you, especially if its .refshoot is greater than 0.
If you see nothing, or you see a shape, it is 0.