Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Xilillusion/Wordle-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

144 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordle Solvers

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 update tree.db

  • test.py: Run to test all solvers and generate an overview

  • Tools\test_result.py: a pre-generated overview for all the solvers

    ScreenShot
  • wordle_solver.py: source code of the Wordle Solver app

    ScreenShotApp

Releases

Download both WordleSolver.exe and word.txt. You can update word.txt with the newest Wordle database.

Download HERE

Note that Window Defender likes to delete the app :(

Handler

  • Handler: Ability to remove words that not match the feedback from the word list
  • search_all=True: set the search range as the entire database, not only the filtered words, which means more iterations and much slower execution

Solvers

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

Description

  • Bayesian: Apply Bayesian search to find the word with highest entropy
  • Minimax: Maximize the minimum gain. Solve in fewest steps
  • Heuristic: Make guess based on the most frequently word
  • Random: Randomly select a word from the word list
  • Fixed: Select the word that in the middle of the word list. A better standard of evaluation than Random Solver

Graphs (from test_result.py)

All (search_all=True)

All

Filtered (search_all=False)

Filtered

Bayesian Solvers

Bayesian

Minimax Solvers

Minimax

Heuristic Solvers

Heuristic

Libraries

  • tqdm
  • matplotlib
  • Tkinter
  • sqlite

About

Bayesian, Minimax and Heuristic solvers for Wordle

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages