A bot that plays Wordle.
Designed to play Wordle and its variants, featuring multiple player types including human, statistical bot, and LLM-powered AI, with both command-line and in-browser play.
- Multiple Game Modes: Supports the classic Wordle and the more challenging Absurdle.
- Player Types:
- Human Player: Interactive command-line interface for manual play.
- Statistical Bot: An AI player that uses letter frequency analysis and statistical methods to make optimal guesses.
- LLM Player: Uses an LLM to generate intelligent guesses.
- Neural-Net Player
- In-Browser Automation: Can simulate human interaction in a web browser.
- Headless Browser Support: Run browser-based games in the background.
- Performance Evaluation: Includes scripts to run extensive game simulations and generate performance statistics and visualization for analysis.
This project uses pipenv for dependency management.
Install Python packages:
pipenv installNext, ensure that geckodriver is installed and available in your system's PATH.
Finally, initialize virtual Python env:
pipenv shellmain.py is the entry point for playing Wordle.
Have the bot play a game of Wordle in a browser:
python main.py --player bot --variant wordlePlay Wordle in a browser, with SALET and UNFIT as the first guesses:
python main.py --player bot --variant wordle --guesses SALET,UNFITHave the bot play a game of Absurdle in a headless browser:
python main.py --player bot --variant absurdle --headlessHave the LLM play a game of Wordle in a browser:
python main.py --player llm --variant wordleTo play a game of Wordle on the command line yourself:
python main.py --player humanUse --help for more information on all available options.
This project is licensed under the MIT License - see the LICENSE file for details.
To run the test suite:
python -m unittest discover testThis project uses coverage.py to measure test coverage.
Run the tests and collect coverage data:
pipenv run coverage run -m unittest discover testView the report in the terminal:
pipenv run coverage report -mGenerate a detailed HTML report:
pipenv run coverage htmlThe report will be saved in htmlcov/index.html.
