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.2.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.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wordle-benchmark-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a03690c724e95c7e3d74c57b20abcf775f2f8c584aaecc6ed7e73c71ebe3b26e
MD5 2700d65c2fb375d500b80789353fbde6
BLAKE2b-256 d49113ba9567aaaa3145ccf41839fcca3bbcd06b4447ee840aef3587b3c49776

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wordle_benchmark-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 899bf82facddb75b9fbc44d7d73e48a3a3525de2a685146468f2ab9541a9d577
MD5 d8c2e08754bf062e1356fdfb10e7042a
BLAKE2b-256 8adcc56a96c2649dbccf2249c1eb804aef9c6963d7d3dd357b0462e98eca541d

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