A simple python bot to solve today's wordle
·
Report Bug
·
Request Feature
Wordle has been fairly liked and much popular game. Solving wordle feels really really good. I built a bot for the same who will do it for, now watching the bot solve the worlde feels much better than me solving it myself.😂😂 I bot opens the wordle site which is (https://www.nytimes.com/games/wordle/index.html) and solves the wordle by itself.
I have used two strategies to solve a problem :
- Randomized Algorithm with some pre info gathering
- Freq distrbution of letters in the valid words
Here are the results for the same when we run it on 1000 words: Strategy 1:
Success Percentage : 70.39999999999999
Failure Percentage : 29.599999999999998
Average Attempts : 4.802556818181818
Strategy 2:
Success Percentage : 87.7
Failure Percentage : 12.3
Average Attempts : 4.6419612314709235
I will further keep improving the bot with some addons. A list of commonly used resources that I found helpful are listed in the acknowledgements. I have listed the source of the data in the acknowledegements.
Getting started with the bot is fairly easy. Make sure you are using an or virtual environment(not compulsory but recommended) for installing all the libraries. Once you have activated your virtual env you can install all the packages with this command below :
pip install -r requirments.txt
Now you can run the bot with:
python wordle.py
To test the bot I have made wordle game which is the wordle_test.py
, you can always change it if you want.
To test bot you can wordle_test.py
:
python wordle_test.py
By default it will run it on 1000 random words, to change the argument you can pass --Nwords
in cli and mention the number of words :
python wordle_test.py --Nwords 100
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request