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

word validators #46

Merged
merged 1 commit into from
Jul 10, 2023
Merged

word validators #46

merged 1 commit into from
Jul 10, 2023

Conversation

joshbduncan
Copy link
Owner

Added

  • Word Validators: Previously, all word validation was done during the WordSearch object initialization (and also after making any changes to the puzzle words). Now, the default validation (no single letter words, no palindromes, no words that fit inside of other words or encase other words) hsa been abstracted away. Each validator is now based on a Validator() abstract base class, allowing users to create their own or disable the defaults. This thought has come up before but because of issue Outputting shortened words of a solution #45 I decided to tackle. Normally in a standard word search puzzle you don't want single-letter words, palindromes, or words that are part of other words, as each of these situations could potentially lead to multiple solutions for the same puzzle.
    • word_validators argument added to WordSearch object
    • --no-validators added to cli arguments to disable default validators
    • Tests updated and added for new functionality

Changed

  • max_fit_tries raised to 1000 to help more words fitting within smaller puzzles

@joshbduncan joshbduncan merged commit 4c8320f into main Jul 10, 2023
3 checks passed
@joshbduncan joshbduncan deleted the word-validation branch July 10, 2023 05:43
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

Successfully merging this pull request may close these issues.

1 participant