Spellsolver is a software that helps to search for the best possible word in Spellcast discord activity. Spellsolver uses a trie to store the valid words, and then iteratively tries all the possible combinations of letters on the board, discarding the ones that don't make valid words and keeping the ones that do.
- Initialization of the trie in single swap mode takes 5 seconds and uses 150 MB of ram memory.
- Once initialized, spellsolver runs almost all single swap queries in less than a second.
A message like this will be printed on the screen while Spellsolver starts
Spellsolver v1.15
WordValidate is being initialized, this will take several seconds
WordValidate successfully initialized (elapsed time: 4.8 seconds)
- python3 (3.9 or later)
- marisa-trie (for store words)
- tk (tkinter for graphicui.py)
- fastapi (for webapi.py)
- uvicorn (for webapi.py)
- Add some spellsolver tests to avoid accidentally introducing new bugs
- Document new changes to the spellsolver algorithm, improvements and bug fixes
- The letters on the board must be written in a single line following the order left -> right and then up -> down with no spaces
- To add a multiplier, the coordinates must be written as two numbers together (eg 34 or 01), multiple coordinates must be separated by a space (in the case of consoleui.py, you must use dots instead of spaces)
- From this folder execute webapi.py
- Navigate to localhost:8080/docs to test the endpoints
# Example solve request body
{
"gameboard": "rslesrotvegifovxqmbabaaif",
"swap": 1,
"gems": "00 01 02 03 04",
"x2_mult": "23",
"dl_mult": "23",
"tl_mult": ""
}
- From this folder execute graphicui.py
- Write the letters on the board in the interface table
- Use the right click to select letter modifiers or to delete them
- Click on one of the buttons to search for words according to the amount of swap you want to use
- From this folder execute consoleui.py
- Write the letters of the board and the rest of the data as indicated above
- The software will return an ordered list with the score, the word and the coordinate of the initial letter
Insert a gameboard: rslesrotvegifovxqmbabaaif
Insert 2x coordinates: 23
Insert DL coordinates: 23
Insert TL coordinates:
Use swap?: 1
The following words have been found (elapsed time: 295.0 milliseconds)
[(66 zoftig (2, 3) | z (2, 3)), (58 vomitory (4, 2) | y (0, 2)), (58 vomitous (4, 2) | u (0, 1)), (58 comfits (3, 3) | c (3, 3)), (58 jabots (2, 3) | j (2, 3)), (58 faqirs (2, 3) | f (2, 3)), (54 fimbria (2, 2) | r (4, 4)), (54 setiform (4, 0) | r (3, 3)), (54 comfit (3, 3) | c (3, 3)), (54 maxing (2, 3) | n (0, 1))]
- From this folder execute consoleui.py with the following arguments as indicated above
- The software will return an ordered list with the score, the word and the coordinate of the initial letter
positional arguments:
game gameboard string
options:
--swap SWAP enable swap mode
--gems GEMS gem coordinates
--ices ICES ice coordinates
--x2 X2 X2 coordinates
--dl DL dl coordinates
--tl TL tl coordinates
example:
python consoleui.py rslesrotvegifovxqmbabaaif --swap 1 --x2 23 --dl 23 --gems 00.01.02.03.04
Some tests have been included to verify the correct working of spellsolver and all its modules To run the tests you can use the following command
python -m unittest discover -s tests -t .
- vscala for providing the base Graphic UI
- SCOWL (And Friends) for providing the generator which was used for the initial wordlist
- Jackson Ray Hamilton for additional words