Finds the optimal solution for a game of Wordle
Project description
WordlePro
An entropy-based Wordle solver that computes optimal guesses using information theory. Given the remaining possible answers, WordlePro selects whichever guess maximizes expected information gain — minimizing the number of guesses needed to solve the puzzle. Supports standard Wordle and multi-board variants like Quordle.
Features
- Optimal guessing — picks the guess with maximum expected entropy across all remaining candidates
- Multi-board support — solve Quordle and other N-board variants with
--boards N - Pattern matrix cache — precomputes the full guess × answer clue table once and caches it to disk; subsequent runs are instant
- Interactive solver — guides you through a live game step by step
- Benchmark mode — runs the solver against every answer word and reports guess-count statistics
Installation
Requires uv.
git clone https://github.com/nhaberla/WordlePro.git
cd WordlePro
uv sync
Usage
Interactive solver
uv run wordlepro solve
WordlePro suggests the best guess each turn. Enter the word you played, then enter the result as a string of digits — 0 (grey), 1 (yellow), 2 (green) — for each board.
Example for a single board:
Suggested guess: CRANE (5.23 bits)
Enter your guess: crane
Enter results (b1): 01200
Multi-board (e.g. Quordle)
uv run wordlepro solve --boards 4
Results are entered space-separated, one per unsolved board:
Enter results (b1 b2 b3 b4): 00000 01100 22222 00120
Benchmark
uv run wordlepro benchmark
Runs the solver against every answer word and prints a distribution table. Use --json for machine-readable output.
uv run wordlepro benchmark --boards 4 --json
Options
| Flag | Default | Description |
|---|---|---|
--boards N |
1 |
Number of simultaneous boards |
--max-guesses N |
6 |
Maximum guesses allowed |
--answers-file PATH |
bundled | Override the answer word list |
--guesses-file PATH |
bundled | Override the allowed guess list |
How it works
- Pattern matrix — for every (guess, answer) pair, encodes the Wordle clue as a base-3 integer (0 = grey, 1 = yellow, 2 = green). This matrix is computed once and cached as a
.npyfile via platformdirs. - Entropy calculation — for each candidate guess, computes the Shannon entropy of the clue distribution across remaining possible answers. Higher entropy → more information gained → fewer guesses expected.
- Guess selection — picks the guess with the highest expected entropy. On multi-board games, entropies are summed across boards.
- Filtering — after each guess, eliminates answers that are inconsistent with the observed clue pattern.
Development
uv run pytest # run tests
uv run mypy --strict src/ # type checking
Author
Noah Haberland — noah17haberland@gmail.com · github.com/nhaberla
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wordlepro-0.2.0.tar.gz.
File metadata
- Download URL: wordlepro-0.2.0.tar.gz
- Upload date:
- Size: 103.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaecfac47cddf0a3ade007e9705a30dd9df5c2f4616cc2d51296f713a0b4d99a
|
|
| MD5 |
53a0efee1c5e291cc2f4d43131470da3
|
|
| BLAKE2b-256 |
3686f6bef696f51e8829f803bb1ada46be0f0d3c7630502c55bd10f342fb6a43
|
Provenance
The following attestation bundles were made for wordlepro-0.2.0.tar.gz:
Publisher:
publish.yml on nhaberla/WordlePro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wordlepro-0.2.0.tar.gz -
Subject digest:
aaecfac47cddf0a3ade007e9705a30dd9df5c2f4616cc2d51296f713a0b4d99a - Sigstore transparency entry: 1806766390
- Sigstore integration time:
-
Permalink:
nhaberla/WordlePro@a655dc50a0d89a9bc7738ec5aeb8ac5d22f4f8d5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nhaberla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a655dc50a0d89a9bc7738ec5aeb8ac5d22f4f8d5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wordlepro-0.2.0-py3-none-any.whl.
File metadata
- Download URL: wordlepro-0.2.0-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99b03013ed86abb8c36c86d8edc4dd2aa1757c7731c65d4f68f20907157793f6
|
|
| MD5 |
f623bb7bffb4ab52f8e25e419914dabb
|
|
| BLAKE2b-256 |
508206c6fa2aa65933e073bd9f2f2ef98aabb94070e7b427589e2cfa137fd5cb
|
Provenance
The following attestation bundles were made for wordlepro-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on nhaberla/WordlePro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wordlepro-0.2.0-py3-none-any.whl -
Subject digest:
99b03013ed86abb8c36c86d8edc4dd2aa1757c7731c65d4f68f20907157793f6 - Sigstore transparency entry: 1806766399
- Sigstore integration time:
-
Permalink:
nhaberla/WordlePro@a655dc50a0d89a9bc7738ec5aeb8ac5d22f4f8d5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nhaberla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a655dc50a0d89a9bc7738ec5aeb8ac5d22f4f8d5 -
Trigger Event:
push
-
Statement type: