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
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 wordle-benchmark-1.0.3.tar.gz.
File metadata
- Download URL: wordle-benchmark-1.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b78a0e1fe85897e28b2e2ee530031d9ea459c1da455a727f06560a23659e24a
|
|
| MD5 |
0861263a185e7b0a69b7229b27cdc2d9
|
|
| BLAKE2b-256 |
e9045ada65565b38e7485485a981c8fc23cfc783ae2c22dc598eaac030dfd5ba
|
File details
Details for the file wordle_benchmark-1.0.3-py3-none-any.whl.
File metadata
- Download URL: wordle_benchmark-1.0.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e725e78d5303a2e35889b82d855a2b3a09c5ecd848c8681b38f124eb89b3998b
|
|
| MD5 |
642e8650af7e9e00068fac4e90c8ac09
|
|
| BLAKE2b-256 |
44cb4f8c6db0eebf1aaa69445265c55612ffb187812dda552beb2b87f8e9d483
|