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

[BUG] Case Rules Called Multiple Times #724

Open
cadogs opened this issue Feb 6, 2024 · 1 comment
Open

[BUG] Case Rules Called Multiple Times #724

cadogs opened this issue Feb 6, 2024 · 1 comment
Labels
bug Something isn't working nurikabe

Comments

@cadogs
Copy link
Collaborator

cadogs commented Feb 6, 2024

Description

In adding a new Nurikabe case rule I found that case rules call itself multiple times. If you put a print statement at the start of the get cases function you'll see that it gets printed multiple times in the BlackOrWhite case rule class and the finish room case rule that may or may not be implemented when you view this. I haven't looked too far into it but in the CaseRule.java class the bottom method "dependentElements" seems to be the source of calling it multiple times. Is this really necessary? Running multiple times doesn't seem to change the function of either case rule but it does increase runtime slightly.

Steps to Reproduce

Add print statement at the start of BlackOrWhiteCaseRule.java method "getCases". Then open up any Nurikabe board and use the Black or White case rule.

Expected Behavior

Only run the getCases function once if it isn't absolutely necessary to run it multiple times

Screenshots

No response

Puzzle Files

No response

Additional Context

No response

@cadogs cadogs added bug Something isn't working nurikabe labels Feb 6, 2024
@charlestian23 charlestian23 changed the title [BUG] <Case Rules Called Multiple Times> [BUG] Case Rules Called Multiple Times Feb 6, 2024
@charlestian23
Copy link
Collaborator

Whoever is working on this bug should also check if this is a Nurikabe specific issue or if this issue is present for other puzzles as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nurikabe
Projects
None yet
Development

No branches or pull requests

2 participants