A package for auto-generating the possible combinations of a boggle grid.
Project description
A recursive method for finding all words in a given square grid.
Installation
pip3 install boggle-solver
Import
from boggle_solver.grid import Grid
Usage
Create a 2-dimensional array and pass this into the package.
from boggle_solver.grid import Grid
grid = [
['M','A','P'],
['E','T','E'],
['D','E','N'],
]
grid=Grid(grid)
To confirm this worked, the below function can be used.
grid.print_grid()
['M', 'A', 'P']
['E', 'T', 'E']
['D', 'E', 'N']
Now you can search for all words. This will take ~10 seconds for a 3x3 grid.
words = grid.find_all_words()
print(words[:10])
['MEAT', 'MET', 'METED', 'MEET', 'MAT', 'MATE', 'MATED', 'MAP', 'EDEN', 'EAT']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
boggle_solver-0.18.tar.gz
(167.0 kB
view hashes)