What's in scope
- t
- seconds since the last restart
- X
- column of each cell,
0…G-1
- Y
- row of each cell
- i
- flat index,
0…N-1
- R
- distance from the centre
- mx my
- the cursor, in cells.
md is 1 while pressed
- cx cy
- the centre of the grid
- G N
- grid size, and
N = G*G cells
- NB
- the 8 wrapped neighbour index vectors, for Life-style rules
The result is read as one value per cell, clamped to
-1…1. Size is magnitude; colour is sign, amber for positive and
cyan negative. An atom fills the grid, so 1 is a legal expression.
Why X and Y are capitals
x and y are k's implicit lambda parameters, so a
global x would be shadowed the moment your expression contains
{…}, as in {sin x}@X. Capitals stay visible inside a lambda.
Two more traps worth knowing: ! with an atom on the left is
mod, not rotate (2!X), and with a vector on the left it builds a
dictionary. % on one argument is square root.
Under it
The same C99 engine that runs natively, compiled to wasm32. Not a
reimplementation and not a subset. A frame crosses the boundary once, as one string of
N bytes, so nothing is parsed per cell.
Want the whole language instead of one line?
Open the Notepad.