Skip to main content

Wordle package to benchmark agents. The package is intended to support replicable heuristic evaluation of Wordle playing software.

Project description

wordle-benchmark

A performant Wordle simulator for benchmarking and evaluating agents.

Do you like Wordle? I like Wordle. I wanted to see if I could teach my computer to play a decent game, but I couldn't find a good way to grade my solutions. I put together a Python package to play Wordle games and keep track of game statistics for Wordle "agents": Python software written to play Wordle.

Getting started

If you want to run scripts, tests, or contribute to the package, pip install from requirements.

pip install -r requirements.txt

If you just want to get started fast, pip install locally after cloning!

git clone https://github.com/peterbbryan/wordle-benchmark.git
cd wordle-benchmark
pip install . 

Sample use

python scripts/play_manual_game.py --word robin

This will prompt for user input and let you play through a game. Note, to run the scripts, you will need additional dependencies included in the requirements.py but not in the setup.py.

The package includes an abstract base class for Wordle agents. I've included a script showing how to evaluate your own software using wordle_benchmark!

python scripts/sample_agent_definition.py --target_words "[plate, train]"

INFO:wordle_benchmark.benchmark.wordle_benchmark:Playing game with target word "plate"
INFO:wordle_benchmark.game.wordle_game:Starting game...
INFO:wordle_benchmark.game.wordle_game:Waiting for guess...
This agent predicts crane
INFO:wordle_benchmark.game.wordle_game:Received guess crane
INFO:wordle_benchmark.game.wordle_game:Waiting for guess...
This agent predicts state
INFO:wordle_benchmark.game.wordle_game:Received guess state
INFO:wordle_benchmark.game.wordle_game:Waiting for guess...
This agent predicts plate
INFO:wordle_benchmark.game.wordle_game:Received guess plate
INFO:wordle_benchmark.game.wordle_game:Ending game
INFO:wordle_benchmark.game.wordle_game:Correct! The word was plate
INFO:wordle_benchmark.benchmark.wordle_benchmark:Playing game with target word "train"
INFO:wordle_benchmark.game.wordle_game:Starting game...
INFO:wordle_benchmark.game.wordle_game:Waiting for guess...
This agent predicts crane
INFO:wordle_benchmark.game.wordle_game:Received guess crane
INFO:wordle_benchmark.game.wordle_game:Waiting for guess...
This agent predicts train
INFO:wordle_benchmark.game.wordle_game:Received guess train
INFO:wordle_benchmark.game.wordle_game:Ending game
INFO:wordle_benchmark.game.wordle_game:Correct! The word was train
BenchmarkResults(average_n_turns=2.5, average_turn_time=0.03678504625956217, percent_successes=1.0, std_turn_time=0.04001420116714126)

Project structure

├── scripts
│   └── play_manual_game.py        |> Basic implementation to exercise the package and demo interfaces.
└── wordle_benchmark
    ├── agents
    │   └── wordle_agent.py        |> ABC of Wordle playing agent and sample concrete implementations.
    ├── dictionary
    │   └── wordle_dictionary.py   |> Dictionary of possible valid Wordle words.
    └── game
        ├── wordle_game.py         |> Logic to handle game play for a specific target word.
        └── wordle_words.py        |> Logic to compare guesses with target words, returning blacks, yellows, and greens.

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

wordle-benchmark-1.0.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

wordle_benchmark-1.0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file wordle-benchmark-1.0.1.tar.gz.

File metadata

  • Download URL: wordle-benchmark-1.0.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for wordle-benchmark-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1b69949329c82af1a153994f66e53ff7eb02dc293c8fcdfbd87a012e2d0a714e
MD5 eaebc890bbe5a64a963a9ef117037430
BLAKE2b-256 c7821a4941ec6909f94d6a1a6dabd6a4bc24b0e8cc2ce9e339f6ab7631f530e5

See more details on using hashes here.

File details

Details for the file wordle_benchmark-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wordle_benchmark-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for wordle_benchmark-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49208aab9f7b3adcdd3bdf6015e9b3ce2fb0513a77de5692d54472e518d07bc0
MD5 0447363206b34d0b1a3717e9515d1a7e
BLAKE2b-256 6449f46b862081470ed802bad7ae4c01b223f2e80a0fddedce8d62813978b66b

See more details on using hashes here.

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