Apply Bayesian/Minimax/Heuristic solvers to solve the Wordle game
-
words.txt: 2308 Wordle words from Silicon Valley Daily -
Tools\game.py: A rough version of Wordle. Run to play manually -
solvers.py: Includes Handler and Solvers. Run to manually test the selected solver -
tree.db: A sqlite database, a tree-like structure to store pre-trained solvers -
decision_tree.py: Read and updatetree.db -
test.py: Run to test all solvers and generate an overview -
Tools\test_result.py: a pre-generated overview for all the solvers
-
wordle_solver.py: source code of the Wordle Solver app
Download both WordleSolver.exe and word.txt. You can update word.txt with the newest Wordle database.
Note that Window Defender likes to delete the app :(
Handler: Ability to remove words that not match the feedback from the word listsearch_all=True: set the search range as the entire database, not only the filtered words, which means more iterations and much slower execution
| Solver | Average Attempts (*Filtered) | (*All) | Time Consumption |
|---|---|---|---|
Bayesian |
3.6050 | 3.5613 | |
Minimax |
3.6786 | 3.6856 | |
Heuristic |
3.6626 | 3.7397 | |
Random |
~4.1 | - | - |
Fixed |
3.9853 | - | - |
*Filtered: search_all=False, All: search_all=True
*In general, the time consumption of Filtered < All
Bayesian: Apply Bayesian search to find the word with highest entropyMinimax: Maximize the minimum gain. Solve in fewest stepsHeuristic: Make guess based on the most frequently wordRandom: Randomly select a word from the word listFixed: Select the word that in the middle of the word list. A better standard of evaluation thanRandomSolver
- tqdm
- matplotlib
- Tkinter
- sqlite