The script wordle_solver.py
will assist you in solving wordle games by automatically eliminating words
that do not work from an english word list, and suggesting the best possible guesses.
- Enter your favorite first word into a wordle game (see Best First Word).
- Run
python3 wordle_solver.py
. - Enter the results from you guess like the example below, where
b
is for black/gray letters,y
is for yellow letters, andg
is for green letters. - Choose one of the top suggestions to enter next.
- Go back to step 3.
Enter guess result:
a,b r,b o,g s,y e,b
The solver uses two strategies:
- The first strategy
char_freq_ranker
ranks potential guess by the sum of the number of words each letter occurs in. - The second strategy
eliminate_ranker
calculates the average number of eliminated words each guess will have, given that the target word is any remaining word.
By running these ranking algorithms once on an entire starting wordlist, we can calculate what will always be the best starting word. Below are the results from running the rankers against the full word list:
Top suggested guesses (char freq ranker):
{'arose': 9170, 'earls': 9067, 'laser': 9067, 'reals': 9067, 'arise': 9027}