Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fpgmaas/boggle
A heuristic that finds all possible words in a Boggle grid.
https://github.com/fpgmaas/boggle
boggle boggle-game boggle-solver optimization python
Last synced: 5 days ago
JSON representation
A heuristic that finds all possible words in a Boggle grid.
- Host: GitHub
- URL: https://github.com/fpgmaas/boggle
- Owner: fpgmaas
- Created: 2021-04-12T10:57:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-11T13:39:04.000Z (about 2 years ago)
- Last Synced: 2024-10-30T13:11:43.599Z (about 2 months ago)
- Topics: boggle, boggle-game, boggle-solver, optimization, python
- Language: Jupyter Notebook
- Homepage:
- Size: 3.01 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Boggle Solver
![](Boggle-Board-2-450x400.png)
### Problem definition
This repository contains a Python script that takes as input an arbitrary grid of letters and finds all words in the grid according to the rules of Boggle. The list of accepted words is the list provided by [OpenTaal](https://github.com/OpenTaal/opentaal-wordlist).
A working example can be found in `notebooks/main.ipynb`.
## Example
```python
boggle_string = 'abcdefghijklmnop'
boggle_grid = BoggleGrid(np.resize([x for x in boggle_string],(4,4)))
boggle = Boggle(boggle_grid,word_list)
all_words = boggle.solve()print('--- BOGGLE ---\n')
print(boggle_grid)print('\n\n--- ALL WORDS ---\n')
print([word['word'] for word in all_words])--- BOGGLE ---
[['a' 'b' 'c' 'd']
['e' 'f' 'g' 'h']
['i' 'j' 'k' 'l']
['m' 'n' 'o' 'p']]--- ALL WORDS ---
['abc', 'bef', 'bei', 'baf', 'cfk', 'fij', 'feb', 'glo', 'ijk', 'ino', 'ink', 'jok', 'jol', 'kop', 'kon', 'kol', 'kno', 'lok', 'mij', 'min', 'mie', 'nop', 'nok', 'nol', 'pon', 'pok', 'pol', 'fijn', 'glop', 'jonk', 'jein', 'klop', 'knop', 'knol', 'knie', 'lonk', 'mijn', 'mink', 'ponk', 'polk', 'plok', 'afijn', 'ojief']
```