Commit Graph
100 Commits
Author SHA1 Message Date
cblanken 9b7b05f79d Fix min python version 2024-06-14 11:09:06 -04:00
cblanken 72f3d20401 Bump patch version 2024-06-14 10:36:21 -04:00
cblanken a611f4a7e7 Fixup board_randomizer typehints
Invalid `list[str]` type hints were causing errors in the downstream Boggler Flask app
2024-06-14 10:31:17 -04:00
cblankenandGitHub e183ce07c0 Update README.md 2024-04-13 10:19:20 -04:00
cblankenandGitHub 09e6f4a672 Update README.md
- Fix bad link to wordlists
- Add license link
2024-02-14 22:49:13 -05:00
cblanken 9036848168 Add collapsible sections to README usage section 2023-08-22 19:06:17 -04:00
cblanken a78b277516 Update CLI usage and output in README 2023-08-22 18:57:12 -04:00
cblanken a2630ed82e Initial blacken reformat 2023-08-22 16:56:59 -04:00
cblanken ab2869b858 Ignore board files for blacken pre-commit 2023-08-22 16:56:18 -04:00
cblanken d282cd3676 Install pre-commit and default blacken format hook 2023-08-22 16:53:38 -04:00
cblanken 995a7f42c1 Update build instructions 2023-08-21 18:45:31 -04:00
cblanken b4d7237c1f Add rich table output to default output 2023-06-02 22:56:24 -04:00
cblanken 3b79ca7519 Update solved 4x4 board tests - check paths
- 4x4 board solving tests now checks for the original order of the words as well as the
exact path for each
2023-05-31 18:08:05 -04:00
cblanken 9e2cd55741 Add function docstrings for board tests 2023-05-31 18:07:40 -04:00
cblanken c0fe222832 Add tests for parsing board input files 2023-05-30 19:35:23 -04:00
cblanken 6771ec9205 Add mypy fix some typing errors 2023-05-29 21:25:38 -04:00
cblanken e1981c44de Use pathlib to handle paths instead of os.path
- Replaces all instances of os.path objects with pathlib.Path
2023-05-26 11:50:30 -04:00
cblanken 02bb7c4262 Replace log format strings with lazy formatting
- Pylint recommends to use lazy formatting (%s) for logging functions
2023-05-26 11:27:47 -04:00
cblanken da00afb395 Add JSON output option 2023-05-26 11:27:47 -04:00
cblanken afaa378131 Add clean text output option
- Output valid words for the provided board in a normal text format, one word per line
    - Select between just word output and word+path output for easier post-processing
    - Also includes sort and de-duplication options
2023-05-26 11:26:06 -04:00
cblanken daebee948a Add pylint to dev depencies 2023-05-24 22:18:50 -04:00
cblanken 2bc9d9fb9e Add argument parsing to main module 2023-05-24 19:20:30 -04:00
cblanken 7500720992 Refactor 4x4 board test to use pytest fixtures
- Update missing symoblic link to boggler src files to access wordlists
2023-05-24 17:37:51 -04:00
cblanken d81f5e28cc Replace unittest with pytest
- Pytest requires test modules to start with the "test_" prefix. The new
test_solve_4x4_board.py module replaces the functional_tests.py module
2023-05-24 16:18:40 -04:00
cblanken a0d60d280c Add poetry script to run main boggler script
- Also correct import for boggler_utils to be relative in __main__.py so it can be run
as module with `python -m boggler`
2023-05-24 12:15:18 -04:00
cblanken ac58828521 Move source files for consistency with Poetry
- By default Poetry build packages into "./packagename/packagename" instead of
"./packagename/src/packagename", this commit reflects that structure even though
poetry _could_ build normally from the original structure
2023-05-24 12:10:32 -04:00
cblanken 59c5beb491 Update project config to use poetry 2023-05-24 11:00:52 -04:00
cblanken 49cf552cc1 Merge branch 'main' into dev 2023-04-24 20:47:41 -04:00
cblanken f0cee00bef Update README.md 2023-04-24 19:25:18 -04:00
cblankenandGitHub 843e167bf4 Update README.md 2023-03-30 19:08:47 -04:00
cblanken 1a1f5acb17 Fix memory warnings/errors/leaks per valgrind 2023-03-30 12:06:13 -04:00
cblanken 2f795be626 Add debug information to compilation flags 2023-03-30 12:05:23 -04:00
cblanken 6f4d4a69a0 Add WordTree data structure and helper functions 2023-03-28 19:05:08 -04:00
cblanken 82991e96e7 Add BoardCell struct 2023-03-27 16:32:11 -04:00
cblanken 1386e1cace Add Makefile 2023-03-24 18:27:44 -04:00
cblanken 8c9ed00826 Initial C implementation commit with Board struct 2023-03-24 18:25:56 -04:00
cblanken c09dce4bd6 Add basic solved board tests 2023-03-23 14:19:28 -04:00
cblanken a37548a4ee Merge branch 'main' into dev 2023-03-23 12:46:02 -04:00
cblanken 1dc118e953 Fix boggle tree missing multi-letter nodes
The BoggleTree object when inserting nodes did not properly check for nodes
with values of more than 1 letter. Therefore, any words with "qu" after the
root would not be included in the solved board. As of now, only nodes with
a maximum of 2 letters are accounted for, 3+ letter nodes won't be checked.
2023-03-23 12:42:40 -04:00
cblanken 6d3a58595c Replace print(s) with logging functions 2023-03-22 16:25:37 -04:00
cblanken 8b9dc89420 Update README with build instructions 2023-03-13 21:53:03 -04:00
cblanken a80111072f Bump release version 2022-12-30 20:55:44 -05:00
cblanken fa01d442a5 Fix bug in board randomizer
- The board randomizer did not account for dice files that don't contain an exact integer squared number of dice. For example the 5x5 dice file contains 26 possible dice since 1 extra die is provided.
- The fix takes the square root of the number of dice and takes the floor of that number as the total number of dice to choose.
2022-12-30 19:54:00 -05:00
cblanken 733c1474b0 Add 5x5 dice file 2022-12-30 19:51:41 -05:00
cblanken 54f79c0afe Remove dead code from boggler.py 2022-11-16 20:37:30 -05:00
cblanken 9f364ee90e Remove old dictionary word prefix lists 2022-11-16 20:36:55 -05:00
cblanken e219954ba6 Add function to flatten boggle board results into 1D list 2022-10-10 12:00:42 -04:00
cblanken f4accfe959 Update wordlist splitting script
- use ripgrep to exclude proper nouns (with capitals) output only the
  capture group
2022-09-28 13:01:39 -04:00
cblanken bc70b88bf7 Bump version 2.0.0 2022-09-26 11:44:51 -04:00
cblanken 21aab46b96 Refactor board_randomizer
- Make file read separate and return "dice" or a list of strings from
  dice handling functions for use in downstream programs
2022-09-26 11:40:36 -04:00
cblanken f18c30cb60 Rename Super Big Boggle dice file 2022-09-23 10:20:48 -04:00
cblanken da915b723c Update wordlist splitting script
- Force lowercase on split
- Only match single (non compound) words
- Don't match punctuation
- Sort and uniquify
2022-09-23 10:20:48 -04:00
cblanken d5a102713d Fix die letters for 'New Boggle' dice 2022-09-23 10:20:38 -04:00
cblanken c488263eea Bump version and update license 2022-09-21 10:15:14 -04:00
cblanken fe1f1c2b97 Fix MAX_WORD_LENGTH parsing 2022-09-21 10:04:02 -04:00
cblanken d2584686a3 Fix max word length
- Previously the max word length parameter was checking the tree depths
  instead of the length of the word
- This fix acounts for multi-letter blocks like 'Qu', 'Tr' etc.
2022-09-21 09:45:09 -04:00
cblanken 8f75604d15 Handle blocks with empty strings and non-existant wordlists 2022-09-20 22:45:57 -04:00
cblanken 96da732dd9 Update board_randomizer module
- Fix typo: randimizer to randomizer
- Add module function to get direct 2d array of board values
2022-09-20 15:58:26 -04:00
cblanken ec53042d18 Update and move word splitting script 2022-09-20 13:21:57 -04:00
cblankenandGitHub 5c18a4aebf Update README.md 2022-09-15 14:06:55 -04:00
cblanken b197253d86 Add 9x9 dice file 2022-09-15 13:44:14 -04:00
cblanken 67f8c439b0 Update release version 2022-09-15 13:44:14 -04:00
cblanken 8c41ad212d Add missing __init__.py for PyPI package 2022-09-15 13:44:14 -04:00
cblanken 94800909b4 Update project version number 2022-09-15 13:44:14 -04:00
cblanken f24b996411 Update README.md 2022-09-15 13:44:14 -04:00
cblanken e4df95cd08 Update .gitignore 2022-09-15 13:44:14 -04:00
cblanken 0e9b120e94 Reorganize files into PyPI package format 2022-09-15 13:44:14 -04:00
cblanken 276c27f1ce Add pyproject.toml for PyPI 2022-09-15 13:44:13 -04:00
cblanken d30c44af3c Add MIT LICENSE 2022-09-15 13:43:55 -04:00
cblanken 5da33cf02c Update dice files 2022-09-07 11:27:09 -04:00
cblanken 600efc19c2 Remove old demo code from boggler_utils.py 2022-09-07 10:29:56 -04:00
cblanken cdb1542184 Fix bug loading duplicate wordlist for multi-letter blocks 2022-09-07 10:28:12 -04:00
cblanken 795f1540b4 Generate '_' words file for 6x6 board 2022-09-06 15:34:01 -04:00
cblanken 91390ea425 Add empty _ word files
The "_" is used to support the "blank" or "block" characters in Super Big Boggle (6x6).
2022-09-06 15:28:15 -04:00
cblanken 2a6a27b0b8 Update 4x4 dice and add 6x6 dice 2022-09-06 15:27:19 -04:00
cblanken b445071ccc Merge branch 'multiprocessing' 2022-09-06 15:10:27 -04:00
cblanken 9c8e94964c Add multiprocessing for board solving 2022-09-06 15:08:26 -04:00
cblanken 2fd5b05717 Update .gitignore 2022-09-01 15:29:37 -04:00
cblanken 0cdd3895ee Add multiprocessing for board solving 2022-09-01 12:42:02 -04:00
cblanken 50d4625b84 Add misc board files and rename dice file 2022-09-01 08:40:06 -04:00
cblanken c88f657113 Add README 2022-08-31 19:44:02 -04:00
cblanken 14a813ed74 Update boards dir with boards in csv format 2022-08-31 14:44:49 -04:00
cblanken 46dd069cfd Track words found in WordTree(s) for easier display 2022-08-31 14:28:30 -04:00
cblanken 31a307e83d Remove old boggler implementation
Update boggler cli to use WordTree implementation
2022-08-31 10:37:02 -04:00
cblanken bc4922dc55 Add printable board 2022-08-31 09:56:47 -04:00
cblanken 5f9a0d1990 Refactor to account for multi-letter nodes
Updates WordTree and WordNodes to build trees with WordNodes containing
blocks that have multiple letters such as "Qu".
2022-08-30 18:00:04 -04:00
cblanken dc532c1fdd Update board_randomizer.py to generate csv board files 2022-08-29 15:21:46 -04:00
cblanken 0f5e5af5ae Update boggler_utils main to accept board.csv file 2022-08-29 15:20:49 -04:00
cblanken 28b3d56880 Update dictionary type hinting 2022-08-26 19:51:52 -04:00
cblanken 79486d4217 Update board_randomizer and dice file 2022-08-26 19:37:32 -04:00
cblanken 6d6d56d1cb Add function to solve entire boggle board 2022-08-26 19:31:49 -04:00
cblanken 88b43d0679 Update WordTree and WordNode to use @property decorators 2022-08-26 16:12:11 -04:00
cblanken 23fa422915 Recursively build WordTree based on boggle board and dictionary 2022-08-26 14:40:51 -04:00
cblanken 3288325d25 Refactor board_randomizer for clarity and pylint recs 2022-08-25 13:00:20 -04:00
cblanken 8bbd7b61b4 Refactor BoggleBoard/BoggleCell with non-public properties 2022-08-25 09:27:29 -04:00
cblanken 7d299961af Add Boggle board and cell abstractions
WIP: Building subtrees of boggle board based on dictionary
2022-08-24 17:18:36 -04:00
cblanken fab34343ae Add .gitignore 2022-08-24 17:00:14 -04:00
cblanken 63647f8270 Add boggler_utils.py
Inlcludes WordTree and WordNode(s) for structuring dictionary data
2022-08-19 17:45:40 -04:00
cblanken c0d4df6993 Reformat to match pylint recommendations 2022-08-19 13:07:30 -04:00
cblanken 1c2614ddb7 Randomize order of dice on the board 2022-03-18 11:54:08 -04:00