Skip to content

Releases: joshbduncan/word-search-generator

Masks on Masks on Masks...

02 May 16:15
Compare
Choose a tag to compare

v3.3.0

More mask fun and some cleanup. Check them out at the links below!

masks

Added

  • New pre-built mask shapes: Club, Fish, Flower, and Spade
  • Testing for built-in masks shapes based on known output
  • 'tools/build_masks_output_dict.py' tool for generating known built-in shapes output dict for us in testing

Club

            * * * * *
          * * * * * * *
        * * * * * * * * *
        * * * * * * * * *
        * * * * * * * * *
        * * * * * * * * *
    * * * * * * * * * * * * *
  * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
  * * * * * * * * * * * * * * *
    * * * * * * * * * * * * *
              * * *
              * * *
        * * * * * * * * *
        * * * * * * * * *

Fish

* * *               * * * * * *
    * * *       * * * * * * * * * *
      * * *   * * * * * * * * * * * *
      * * * * * * * * * * * * * * * * *
        * * * * * * * * * * * * * * * * *
        * * * * * * * * * * * * * * * * *
        * * * * * * * * * * * * * * * * *
        * * * * * * * * * * * * * * * * *
        * * * * * * * * * * * * * * * * *
      * * * * * * * * * * * * * * * * *
      * * *   * * * * * * * * * * * *
    * * *       * * * * * * * * * *
* * *               * * * * * *

Flower

              * * * * * * *
          * * * * * * * * * * *
        * * * * * * * * * * * * *
        * * * * * * * * * * * * *
    * *   * * * * * * * * * * *   * *
  * * * *   * * * * * * * * *   * * * *
  * * * * *   * * *   * * *   * * * * *
* * * * * * *   * *   * *   * * * * * * *
* * * * * * * *   *   *   * * * * * * * *
* * * * * * * * *       * * * * * * * * *
* * * * * *                   * * * * * *
* * * * * * * * *       * * * * * * * * *
* * * * * * * *   *   *   * * * * * * * *
* * * * * * *   * *   * *   * * * * * * *
  * * * * *   * * *   * * *   * * * * *
  * * * *   * * * * * * * * *   * * * *
    * *   * * * * * * * * * * *   * *
        * * * * * * * * * * * * *
        * * * * * * * * * * * * *
          * * * * * * * * * * *
              * * * * * * *

Spade

                *
              * * *
              * * * *
            * * * * *
          * * * * * * *
        * * * * * * * * *
        * * * * * * * * * *
      * * * * * * * * * * *
    * * * * * * * * * * * * *
  * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
  * * * * * * * * * * * * * * *
    * * * * * * * * * * * * *
              * * *
              * * *
        * * * * * * * * *
        * * * * * * * * *

Fixed

  • During mask generation, each class and subclass now refers to their own build_mask() method instead of the base class.
  • Incorrect horizontal center calculation for Spade and Club masks on even sized masks.

Changed

  • The .random_words() method default to NOT resetting the puzzle size.
  • Radius calculation for the RegularPolygon mask.
  • If the random_words() method is called on an empty WordSearch() object, an appropriate puzzle size is calculated.
  • Cleaned up variable naming a bit to make things clear
    • cli.py BUILTIN_SHAPES -> BUILTIN_MASK_SHAPES_OBJECTS
    • shapes.py MASK_SHAPES -> BUILTIN_MASK_SHAPES
  • Cleaned up calculation of built-in shape objects
  • Cleaned up imports for 'test/init.py'
  • README and wiki mention puzzle masking.

Removed

  • make_header() function no longer needed as header is created with f-strings now

Speeeeeeeeeed!!! 🔥

20 Jan 23:21
Compare
Choose a tag to compare

v3.1.0

Some small improvements that result in a 50% increase in puzzle generation speed 🏎

giphy

Added

  • PuzzleNotGenerated is raised if a mask is applied to a puzzle that had yet to be generated, either because it doesn't yet have words or doesn't yet have a size.
  • PuzzleSizeError is now raised if the current puzzle size is smaller than the shortest words in the wordlist.
  • Additional tests to keep coverage at 100%.

Changed

  • WordSearch.random_words() now accepts an "action" argument. This determines whether the random words are added ("ADD") to the current wordlist or replace ("REPLACE") the current wordlist. Defaults to "REPLACE".
  • no_duped_words() refactored to speed up puzzle generation especially on large puzzles and puzzles with large wordlists.
  • fill_words() refactored to stop adding words or secret words if placed words > config.max_puzzle_words.
  • try_to_fit_word() refactored to no longer use deepcopy. While trying a new word, all changes are made to the actual puzzle, changes are also tracked in previous_chars. If a word ends up not fitting, the function backtracks and reset the puzzle to the previous_chars.
  • calc_puzzle_size() now maxes out at config.max_puzzle_words no matter the caculation result.
  • Generation tests updated to work with above changes.

Removed

  • no_matching_neighbors()
  • capture_all_paths_from_position()

v3.0.0

03 Jan 03:34
Compare
Choose a tag to compare

SSSSSSMOKIN'!

So, it seems you can add even more features to an already overcomplicated word-search puzzle generator 🤦‍♂️...

👺 Puzzle Masking

smokin

@duck57 started working on the idea of masking puzzles with issue #20, and here's the final result.

-----------------------------------------
               WORD SEARCH
-----------------------------------------
              I U D A J L W
          H E A R C W V N J V E
        N M D I O M R U X W I L L
      E A O A N J E O C I U K V P G
    S F M F     L T P A Z     U J T M
  B L U Y F     S H G M S     Y H G O F
  W S G T I     O O T E I     U F X C E
U X L A D C     C D H R N     J N K L V P
J N F T E I     I L E A C     K E B M L R
K W S C D A     A T S K E     D I U A Z O
X Q A J O L G U L B E O C R I S A E C E V
V E U C Z N N O T H I N G S S E D I G X E
P X Q K O W U E M E F O N O R Q L A P Y H
T J W S P     V Z C L I P A     H E R D W
  R P R Y                       T O R F
  G X F U W                   I T A Q A
    A V A I L A B L E A W M P S E W G
      B R U X Q F X E R K S I F H I
        K I Z E M D A B E H T J D
          F J N I C E D U Y Z I
              B J P Y B N H

Read all about puzzle masking in the new Wiki docs.

Somebody stop me!

♻️ Random Word Puzzles

🤷‍♂️ Can't think of any clever words for your puzzle. No problem...

>>> from word_search_generator import WordSearch
>>> puzzle = WordSearch()
>>> puzzle.random_words(10)

📑 Project Documentation

With all of the new features, I figured it was time to write some documentation... Read the docs in the GitHub project wiki. And, I'm certain I overlooked some things, so let me know if you need clarification on anything.

HAPPY WORD-SEARCHING ✌️

v2.0.0

02 Dec 05:30
Compare
Choose a tag to compare
  • Test for csv output with solution

  • Secret Words (contributed by Chris J.M. duck57)

    • The WordSearch object can now accept a list of secret bonus words
      • are included in the puzzle but not listed in the word list
      • are included in the answer key and tagged with an * like '*word'.
      • A puzzle can consist of only secret words
      • Implemented in the CLI as -x, --secret-words
    • Introduced the Direction class
      • Allows for specifying either a preset numeric level or accepted cardinal direction for puzzle words.
      • Implemented in the CLI as -d, --difficulty
    • Testing for all new secret word features and accompanying functionality
    • Updated README with new features
  • New -rx, --random-secret-words CLI argument

  • All typing updated to be backward compatible with Python 3.7 so minimum version has been adjusted.

  • Most all supplemental function now work the base WordSearch object, reducing the of arguments needing to be passed around, and also reducing memory usage

  • Puzzle config settings

    • min_puzzle_size == 5
    • max_puzzle_size == 50
    • max_puzzle_words == 100
  • PDF generator updated to work with larger puzzles and word lists

  • Removed the tty input from the cli as it's confusing for most users.

  • CLI flag -l, --level was combined with -d, --difficulty (for backward compatibility)

  • Lots of types refactoring by contributed by duck57

  • clean up main call to cli

  • Word class

    • WordSearch.words property is now a set of Word objects
      • Allows unused words to be kept around in case they fit in re-generated version o the puzzle.
    • Allows easier tracking of all words properties
    • Allows easier access to words of different types
      • WordSearch.words == all available puzzle words
      • WordSearch.placed_words == all words placed in the puzzle (no matter of word type)
      • WordSearch.hidden_words == all available "regular" words
      • WordSearch.placed_hidden_words == all "regular" words placed in the puzzle
      • WordSearch.secret_words == all available "secret" words
      • WordSearch.placed_secret_words == all "secret" words placed in the puzzle

v1.3.0

01 Aug 16:13
Compare
Choose a tag to compare

Enhancements v1.3.0

Added

  • -c, --cheat options for cli to show puzzle solution
  • --version flag added to cli
  • eq magic method for checking if puzzles are the same (mostly for testing repr)

Changed