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

Reverse Prefix in rules #100

Open
3 tasks done
just-kirb opened this issue Sep 6, 2024 · 4 comments
Open
3 tasks done

Reverse Prefix in rules #100

just-kirb opened this issue Sep 6, 2024 · 4 comments
Labels
enhancement Improvement to existing capability

Comments

@just-kirb
Copy link

just-kirb commented Sep 6, 2024

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

  • I have searched the tracker for similar issues (including closed ones)
  • I have provided a detailed example for how this feature should work
  • I have provided a use case for this feature, e.g. short description/share link of a game you're making and how you'd use the feature in that game, other things you've tried, edge cases, etc. (if applicable)

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.

@just-kirb just-kirb added the enhancement Improvement to existing capability label Sep 6, 2024
@david-pfx
Copy link
Owner

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

@just-kirb
Copy link
Author

during rule application

@just-kirb just-kirb reopened this Sep 15, 2024
@david-pfx
Copy link
Owner

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

@just-kirb
Copy link
Author

just-kirb commented Sep 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing capability
Projects
None yet
Development

No branches or pull requests

2 participants