Skip to content

danagle/boggled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About Boggled

This is a simple Boggle solver/generator package I created as part of a pet project to give a young person in our household a fighting chance against their older siblings.

The project was also intended as a learning opportunity for my son so the code has been documented well enough for a child to understand how it works.

Note

Neither a dictionary file nor the letters for creating the Boggle dice are provided with the package as I didn't want to tie the package to any particular language. There are suitable resources freely available online.

WordGameDictionary.com

The following links detail the letter distributions for various versions of the official game:

Simple Solver Example

from boggled import BoggleBoard, BoggleSolver, BoggleWords

words_file = "english.txt"
letters = "AILN SNLC IHIF QU DIK"

gameBoard = BoggleBoard(letters)
gameWords = BoggleWords()
gameWords.loadFromFile(words_file)

solver = BoggleSolver(gameBoard, gameWords)

solver.solve()

print(solver.foundWords)

If the dictionary provided the words, the following list would be output:

['ASH', 'DILL', 'DISH', 'FILL', 'FIN', 'FINISH', 'FINS', 'HILL',
 'ILL', 'KID', 'KILN', 'KIN', 'LID', 'NAIL', 'NASH', 'NIL',
 'QUID', 'SAIL', 'SHIN', 'SILL', 'SIN', 'SNAIL']

TODO

[] Write better tests

  • There is 99% test coverage of the code but the quality of the tests could be improved.

[] Add examples of usage.

Thanks

A big thank you to the creators of Boggle as it has provided endless hours of entertainment in our house.

BoggleTM is a registered trademark of Hasbro, Inc.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages