A Python implementation of the classic Wordle word-guessing game, bundled with intelligent solver/helper tools. Play the game through a graphical interface, or use the helper tools (CLI or GUI) to get optimal word suggestions while playing Wordle elsewhere.
Wordle Game — A fully playable Wordle clone with a dark-themed tkinter GUI. Guess a hidden 5-letter word in 6 attempts, with color-coded feedback (green, yellow, gray) after each guess. Includes reset and new-game controls.
Wordle Helper (CLI) — A terminal-based assistant. Enter your guesses and the color feedback you received, and the helper narrows down the candidate word list and suggests optimal next guesses ranked by letter-frequency scoring.
Wordle Helper (GUI) — The same constraint-solving logic as the CLI helper, wrapped in a tkinter interface. Type your guess, click each letter tile to cycle through green/yellow/gray, and submit to see ranked suggestions and a running guess history.
WordleSolver/
├── main.py # Entry point — menu to launch any mode
├── wordle_game.py # Playable Wordle game (tkinter GUI)
├── wordle_helper.py # CLI-based Wordle solver/helper
├── wordle_helper_gui.py # GUI-based Wordle solver/helper (tkinter)
├── dictionary_manager.py # Shared dictionary loader and word filtering
├── words.txt # Dictionary of 5,758 five-letter words
├── requirements.txt # Dependencies (stdlib only)
└── .gitignore
- Python 3.10 or later
- tkinter (included with most Python installations)
If tkinter is not installed:
- Ubuntu/Debian:
sudo apt-get install python3-tk - Fedora:
sudo dnf install python3-tkinter - macOS: Included with the official Python installer from python.org
No external packages are needed — the project uses only the Python standard library.
python main.pyYou'll be prompted to choose between the three modes (game, CLI helper, or GUI helper).
# Play the Wordle game
python wordle_game.py
# Use the CLI helper
python wordle_helper.py
# Use the GUI helper
python wordle_helper_gui.py- Launch the game. A random 5-letter target word is chosen.
- Type a 5-letter word using your keyboard and press Enter.
- Each tile changes color:
- Green — correct letter in the correct position
- Yellow — correct letter in the wrong position
- Gray — letter is not in the word
- You have 6 attempts to guess the word.
- Use Backspace to delete letters, Reset Game to retry the same word, or New Game to pick a fresh word.
- Run
python wordle_helper.py. - Enter the 5-letter word you guessed in your external Wordle game.
- Enter the color feedback as a 5-character string:
g= green,y= yellow,x= gray. For example, if you guessed CRANE and got green-gray-yellow-gray-green, entergxygxg— wait, that's 6 chars. Entergxyxg. - The helper displays the top 5 suggested words for your next guess.
- Repeat for up to 5 rounds, or type
exitto quit.
- Run
python wordle_helper_gui.py. - Type your 5-letter guess in the input field.
- Click each letter button to cycle its color (default → green → yellow → gray → default).
- Click Submit Guess.
- View ranked suggestions in the bottom panel and your guess history in the middle panel.
- Click Reset Game to start over.
The solver uses a letter-frequency scoring algorithm to rank candidate words:
- After each guess, positional constraints (green, yellow, gray) are recorded.
- The full dictionary is filtered down to words satisfying all constraints.
- Each remaining word is scored by summing the relative frequency of its unique letters across the remaining candidate pool.
- A penalty is applied for duplicate letters (words with all unique letters are preferred early on since they reveal more information).
- The top-scoring words are presented as suggestions.
The included words.txt contains 5,758 valid 5-letter English words. The dictionary manager also filters these down to an "answer pool" of 5,345 words by excluding words with very rare letters (Q, X, Z), words with multiple uncommon letters, and words where any single letter appears more than twice — ensuring fair and enjoyable gameplay.
If words.txt is not found at runtime, a built-in fallback list of common words is used automatically.
This project is provided as-is for educational and personal use.