Actions

Use the action keyword to give actions to an element. Actions don't end an atom's behaviour when they match (like rules do).

element Dropper {
    change S () => new Sand()
    
    // Drop some sand below me
    action {
        @ => @
        _    S
    }
    
    // Afterwards... move into space
    any(xyz.directions) @_ => _@
}

Last updated