*<numero> | *.<sysvar>
An asterisk attached to a number or a sysvar pushes the contents of that memory cell: it's how you read the senses and your own variables.
Facts
- Word
*<numero> | *.<sysvar>- Family
- Numbers and reads
- What it does
- Pushes what is in that memory cell. You read a sense the engine writes in the next cycle.
- Value
- The address of the cell, from 1 to 1000. Outside that range the sign is dropped and the remainder of dividing by 1000 is taken; 0, or a misspelled sysvar, reads 1000.
- Cost
- Each read is charged the cost *.number read (0 with the F1 rules).
- Runs
- inside a gene: in the condition (cond) and in the body (start or else)
*50 pushes what's in cell 50; *.nrg pushes what's in the cell of .nrg, that is, the bot's energy. It is the word a bot uses to find out about everything: its senses, its state and what it stored in free memory.
A few things worth knowing:
- The senses arrive one cycle late. The engine publishes them after the DNA runs, so in a bot's first cycle of life almost everything reads as 0 (see Execution and costs).
- The address is normalized. If it is outside 1 to 1000, its sign is dropped and the remainder of dividing by 1000 is taken:
*1050reads cell 50 and*0reads cell 1000. - A misspelled sysvar reads cell 1000.
*.nrggdoesn't exist, it counts as*0, and it pushes whatever is in cell 1000 without any warning (the editor does flag it for you). - The address is written into the DNA. If it has to come out of a calculation, use the operator
*:60 *reads the same as*60, but the 60 can come from the stack.
This bot moves forward only when the central eye (.eye5) sees something:
cond
*.eye5 0 >
start
10 .up store
stopEach read costs *.number read, which under the F1 rules is 0. More in Numbers and addresses and Free and epigenetic memory.