Skip to content

ian1roberts/boggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

B O G G L E

Welcome to Boggle

Playing the Game

Quick start play, simply invoke from command line:

$ boggle --minwordlength 3 --maxwordlength 9 cat dog hog

This command will find all 3, 4, 5, 6, 7, 8 and 9 letter words that exist within the boggle grid.

Switches

Modify behaviour with the following command line options:

--minwordlength ... set the minimum length of found words (default 3) --maxwordlength ... set the maximum length of found words (default 9) --overwrite ... recompute board objects and replace existing data file --nodisplay ... do not display found words on screen (False) --filename ... filename of output (boggle_words.tsv) --charts ... export boggle board picture (False) --debug ... return objects when running in python interpreter (False) --use-legacy ... use the legacy networkx-based implementation (slower)

Note that the longer the word, the longer the run time, and the bigger the data file.

Optimized Algorithm

By default, the application now uses an optimized trie-based algorithm for finding words, which is significantly faster than the original networkx-based implementation. If you need to use the original implementation, you can use the --use-legacy flag.

Performance improvements:

  • Uses a trie data structure for efficient word prefix lookups
  • Employs depth-first search directly on the grid
  • Eliminates the need to build directed graphs for each origin point
  • Optimized for multicore processing

Output

Output file displays the found words, alphabetically ordered by length, in three columns. First column contains the length, second column is the word, and the last column provides the coordinates of the word path. Coordinates are in XY format:

Length    Word    path
3         cat     ((0, 2), (1, 2), (2, 2))

Output file will be written to the directory in which boggle was executed.

Installation

Install with Poetry (recommended), pip, or directly from GitHub:

# Using Poetry (recommended)
poetry install

# Using pip
pip install git+https://github.com/ian1roberts/boggle.git

About

Solves boggle like word puzzles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages