0
Press ENTER to load the new code for a particle!
Use runes to create programs for your particles!
Definitions:
push - push onto the main stack
pop - pop off the main stack
last - top entry on the stack
The starting particle is pushed automatically at the start, it (and other particle pushes) includes:
x, y - position
t - type (0-15 normal, 16 for out-of-bounds)
Here're some basic runes:
<>^v - push a particle in that direction
@ - push a particle at position (x=last, y=secondlast)
1234567890 - push number (continuous, an input of 100 will push the number "100", not "1" "0" "0")
, - number separator (multi-number push - 1,0,0 will push "1" "0" "0")
_ - pop
$ - copy last
q - swap last 2 particles by reference on grid
s - store on 2nd stack (non-pop)
l - load from 2nd stack (non-pop)
o - pop 2nd stack
. - extract a entry on last, like:
.[sqrt] - extract .sqrt of last
.x, .y - extract .x or .y of last
Math:
m - push the lua math library, which includes sqrt, sin, cos, log, pi, random, etc.
+ - push sum of last 2
- - negate last
* - push product of last 2
r - push the reciprocal of last
% - push mod last 2 (top-first)
# - push a random integer from 0 to last
Logic:
/ = push last greater than secondlast
\ = push last less than secondlast
= - push last equal to secondlast
! - push not last
& - push and last 2
| - push or last 2
?([code]:[code]) - if last : else
~([code]) - while last
Examples:
sand: v.t0=?(___q:[email protected]=?(___pq:[email protected]=?(___pq)))
water: v.t0=?(___q:1#=?(>.t0=?(___pq):<.t0=?(___pq)))