A command-line Wordle solver built in a focused 12-hour session. It scores and ranks all 8,000+ five-letter English words by letter frequency, then uses regex-based filtering to narrow the solution space after each guess. No machine learning, no information theory — just frequency analysis and elimination.
How It Works
- Word Scoring — Every five-letter word is pre-ranked by a composite score: the sum of each unique letter's frequency across the entire word universe. The opener
RATESranks #1. - Guess & Filter — After each guess, color-coded feedback (green, yellow, gray) drives regex-based elimination of impossible words, including correct handling of duplicate letters.
- Greedy Selection — The solver always picks the highest-ranked remaining word. No lookahead, no entropy calculation.
Benchmarked Performance
Tested against all 1,062 historical NYT Wordle answers:
| Metric | Result |
|---|---|
| Average Guesses | 3.79 |
| Win Rate | 97.9% (1,040 / 1,062) |
| Losses | 22 words required 7 guesses |
| Most Common Result | 4 guesses (38.5%) |
Guess distribution:
| Guesses | Count | Share |
|---|---|---|
| 2 | 61 | 5.9% |
| 3 | 357 | 34.3% |
| 4 | 400 | 38.5% |
| 5 | 180 | 17.3% |
| 6 | 42 | 4.0% |
How It Compares
| Solver | Avg Guesses | Win Rate | Approach |
|---|---|---|---|
| Optimal (decision tree) | 3.42 | 100% | Full lookahead tree search |
| 3Blue1Brown (entropy) | 3.43 | 100% | Greedy Shannon entropy |
| NYT WordleBot | ~3.48 | 100% | Heuristic evaluation |
| This solver | 3.79 | 97.9% | Letter frequency + regex |
| Average human player | 3.80 | ~98.6% | Intuition + vocabulary |
The solver lands right at human-level performance — 0.37 guesses behind the mathematical optimum — using nothing but letter frequency and pattern matching. The 2.1% failure rate comes from words with uncommon consonants or repeated letters where frequency heuristics get stuck.
Features
- Live Assist Mode — Run
solve_game.pyalongside the real NYT puzzle; enter feedback and get suggestions in real time - Batch Benchmarking — Run
solve_on_answer_list.pyagainst any word list to measure performance at scale - Playable Game — Run
game.pyto play a full round locally with optional debug levels that reveal hints, suggestions, or the answer
Usage
# Play a round
python game.py
# Get solver assistance for a live puzzle
python solve_game.py
# Test the solver on a specific word
python solve_on_answer.py crane
# Benchmark against historical answers
python solve_on_answer_list.py
