Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ellipsis #218

Closed
wants to merge 2 commits into from
Closed

Ellipsis #218

wants to merge 2 commits into from

Commits on Jun 1, 2014

  1. Handle ellipses as CellPattern objects.

    Previously, ellipses were a special value, which meant that all of the
    logic around them had to be special-cased every time.  Now, they are
    represented as CellPattern objects with "hasEllipsis" set to true.
    sfiera committed Jun 1, 2014
    Configuration menu
    Copy the full SHA
    0a6a8f6 View commit details
    Browse the repository at this point in the history
  2. Support matching on ellipsis.

    Ellipsis no longer needs to be alone; it just needs to be last.  The
    ellipsis will only span over matching blocks.  This is useful for
    line-of-sight sorts of things. For example, the rule for the Wizard in
    Heroes of Sokoban can be simplified to:
    
        [ > Wizard | no Wall no Crate ... | Crate ] -> [ Crate | ... | Wizard ]
    
    Heroes of Sokoban III uses this more complicated formulation:
    
        [ > Wizard ] -> [ Wizard > Warpball]
        [ > Warpball | no Crate no Wall] -> [ | > Warpball]
        [ > Warpball | Wall] [Wizard] -> [ | Wall ] [> Wizard]
        [ > Warpball | Crate ] [Wizard] -> [ | Wizard ] [Crate]
        [ > Warpball] [Wizard] -> [] [> Wizard]
    
    This extension is backwards-compatible; an ellipsis pattern "A|B ...|C"
    matches "A|C", "A|B|C", "A|B|B|C", etc., so if B is empty, the pattern
    naturally matches "A|C", "A||C", "A|||C", etc.
    sfiera committed Jun 1, 2014
    Configuration menu
    Copy the full SHA
    4ed57b5 View commit details
    Browse the repository at this point in the history