Skip to main content

Finds the optimal solution for a game of Wordle

Project description

WordlePro

Python uv mypy License: MIT GitHub repo

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

  1. 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 .npy file via platformdirs.
  2. 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.
  3. Guess selection — picks the guess with the highest expected entropy. On multi-board games, entropies are summed across boards.
  4. 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 Haberlandnoah17haberland@gmail.com · github.com/nhaberla

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordlepro-0.1.0.tar.gz (98.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordlepro-0.1.0-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file wordlepro-0.1.0.tar.gz.

File metadata

  • Download URL: wordlepro-0.1.0.tar.gz
  • Upload date:
  • Size: 98.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wordlepro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4a9a276f2f7d9afe5da97561097e66ff24caacb57de170aa4b3e45f55280841
MD5 8a0b49ff5dd9d7c2a479f062c1a198bb
BLAKE2b-256 9550a2f0a6af7b166c0ca5e1af1fda91000799fa238b9e60bd16989982168bce

See more details on using hashes here.

Provenance

The following attestation bundles were made for wordlepro-0.1.0.tar.gz:

Publisher: publish.yml on nhaberla/WordlePro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wordlepro-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wordlepro-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wordlepro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6c5407b267b0ddd945677c7e6612089d9d3f068690477688e6e35a29f3c03a0
MD5 c47e7c42a0aec02a43c261589fbcd9fc
BLAKE2b-256 0117cf870df5a1f8cb22c4acea2021ca1226b8a455ebe87e0d586e438d552176

See more details on using hashes here.

Provenance

The following attestation bundles were made for wordlepro-0.1.0-py3-none-any.whl:

Publisher: publish.yml on nhaberla/WordlePro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page