david-pfx / PuzzleScriptNext

A direct successor to PuzzleScript, building on the work of PuzzleScript Plus, Pattern:Script and others.
http://www.puzzlescriptnext.polyomino.com
MIT License
11 stars 4 forks source link

Reverse Prefix in rules #100

Open just-kirb opened 2 weeks ago

just-kirb commented 2 weeks ago

Check ([ ] -> [x]) all that apply, then describe the issue below:

There should be a feature to have a prefix in a rule to reverse the rule priority order where up to down and left to right rule application within one rule becomes down to up and right to left. Example: So lets say you want to move the Xs exactly one tile to the left with a rule without invoking movement directions, since it requires going through all the rules, it can be done easily like this: once left [X|]->[|X] ?(?x)xxx?? ->?(x?)xxx?? ?x(?x)xx?? ->?x(x?)xx?? ?xx(?x)x??->?xx(x?)x?? ?xxx(?x)??->?xxx(x?)?? ??xxxx?? becomes ?xxxx??? however, making a similar rule once right [X|]->[|X] doesn't work, as the leftmost x gets applied first regardless of what happens, causing the other xs to be deleted ??(xx)xx?? ->??(?x)xx?? ???(xx)x?? ->???(?x)x?? ????(xx)??->????(?x)?? ?????(x?)?->?????(?x)? ??xxxx?? becomes ??????x?

once right [X| no X]->[|X] doesn't work either as it only runs the rightmost X once ??xxx(x?)?->??xxx(?x)? ??xxxx?? becomes ??xxx?x? with a reverse prefix however, the rule runs the check from right to left and down to up once reverse right [X| no X]->[|X] ??xxx(x?)? ->??xxx(?x)? ??xx(x?)x? -> ??xx(?x)x? ??x(x?)xx? -> ??x(?x)xx? ??(x?)xxx? -> ??(?x)xxx? ??xxxx?? becomes ???xxxx? Reason to implement the feature: As mentioned, it allows an easier way to move objects without directional actions that requires finishing the rules , and allows a solution for some cases where the order of applying 1 rule becomes an issue.

david-pfx commented 1 week ago

Not aware of this as a problem, need a repro case. Is this during rule application, or movement phase?

just-kirb commented 1 week ago

during rule application

david-pfx commented 6 days ago

And the code that triggers it? Without a repro case there I don't know where to start.

just-kirb commented 6 days ago

https://puzzlescriptnext.polyomino.com/play.html?p=e539b37ef9508747b8ba8c9f948c4d2c

On Mon, Sep 16, 2024 at 8:24 AM david-pfx @.***> wrote:

And the code that triggers it? Without a repro case there I don't know where to start.

— Reply to this email directly, view it on GitHub https://github.com/david-pfx/PuzzleScriptNext/issues/100#issuecomment-2351855556, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKAS3CUHWKCALNUXO6QUKVTZWYQM5AVCNFSM6AAAAABNYJL6DKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRHA2TKNJVGY . You are receiving this because you modified the open/close state.Message ID: @.***>