Symbols
Last updated
Was this helpful?
Last updated
Was this helpful?
In the SandPond engine, there are already some in-built and symbols. You can also make your own symbols with these keywords. Define what they do by writing a JavaScript function. Name the arguments you want to use from the .
All given
inputs must be true for a rule to be chosen.
If there is a water atom above me, delete it.
change
outputs say what atom to put in a space.
This makes a water atom and places it below.
keep
outputs don't do anything. They just leave that space how it is.
This does nothing...
Keeps can still have a function like usual, so they are useful for side-effects.
select
inputs save data that can be used in an output.
This selects a water atom below, and swaps places with it.
All check
inputs must be true for a rule to be chosen. Only one check
function is done per symbol. Unlike given
, it is never cached during an event.
origin
symbols show where the centre of the diagram is.