Rules

You can give an element rules by drawing rule diagrams:

element Sand {
    @ => _
    _    @
}

An element's rules show how it acts in the world. It checks its surroundings to see if it matches the left-hand-side of the rule (the inputs). If it matches, it changes it to look like the right-hand-side of the rule (the outputs). Rules are checked in order. The first rule to match is the one that gets used.

Check out the diagrams page for more information on diagrams.

Rule Keyword

You can optionally use the rule keyword, which may improve readability in longer elements:

element Sand {
    rule {
        @ => _
        _    @
    }
}

Last updated