Read
read puts into a variable something taken from someone, by address. Who that someone is
is decided by the second field, and what the address means depends on it too:
| Who we read from | What the address means | What we get |
|---|---|---|
| a memory cell or bank | a slot number, from zero | a number or an object |
| another processor | a variable name in quotes | its variable or its link |
| a string | a character index, from zero | the character’s code |
These cases have more in common than it seems: an address out of range is never an error anywhere, and the answer is always emptiness. A block that cannot be read from answers with the same.
Lessons
Section titled “Lessons”- The memory cellA processor's memory dies with every edit to the program. A cell remembers — and you fetch from it by slot number
- Another processor's variablesA cell for exchanging values isn't always needed: a neighbour's variable can be taken straight from it, by name
- A character from a stringA string is read by address too: a character index instead of a slot number, a character code instead of a value
What you need first
Section titled “What you need first”«Links and getlink» — how a processor sees neighbouring blocks at all, and «Emptiness: null» — how it differs from zero. The lessons will tell you the rest themselves.
Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.