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

Question about commented code and strategies #3

Open
Joxter opened this issue May 25, 2024 · 1 comment
Open

Question about commented code and strategies #3

Joxter opened this issue May 25, 2024 · 1 comment

Comments

@Joxter
Copy link

Joxter commented May 25, 2024

Hey, thank you for the project, it implements many human strategies and is very handy for learning and defining difficulties.

I'm just curious about the commented code, mostly dealing with different strategies. Why? What's wrong with them?

I also heard about several more advanced strategies (XWing, Swordfish, Jellyfish, XYWing, XYZWing). What about them?

Thank you

@Joxter
Copy link
Author

Joxter commented May 29, 2024

hi again, I have another question!:)

Could you please explain how removeCandidatesFromMultipleCells works?

        //-1 because candidate '1' is at index 0 etc.
        if (candidate && cellCandidates[candidate - 1] !== null) {
          cellCandidates[candidate - 1] = null; //NOTE: also deletes them from board variable

As far as I understand: the cellCandidates is an array of candidates and the candidate index has nothing to do with its value. So cellCandidates[candidate - 1] !== null looks confusing.

It must be something like cellCandidates.contains(candidate). But it breaks several "solve method" tests. I'm totally confused.

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

No branches or pull requests

1 participant