A Wordle-Solver designed to minimize the expected number of guesses needed to solve the puzzle.
Here are the instructions for setting up and running your Wordle bot in Python:
Start by cloning the repository from GitHub to your local machine:
git clone https://github.com/SGD2718/Wordle-Solver.git
cd Wordle-Solver
Ensure you have Python installed on your system. The program relies on the following built-in Python libraries, so no additional installations should be necessary:
mathtkinter(for GUI support)concurrent.futurestimeos
To verify that Python is installed, run the following command:
python –versionIf Python is not installed, download and install it from https://www.python.org/downloads/
The repository includes the following files:
Wordle Outcome Generator.py: Script for generating Wordle outcomes.WordleBot GUI.py: The main GUI interface for the solver.answers.txt: A list of valid Wordle answers.guesses.txt: A list of valid Wordle guesses.
Run the following bash script to build the precomputed table of colorings:
python “Wordle Outcome Generator.py”Once this is complete, you should see a file called outcomes.txt in your working directory.
Follow these steps to run the bot:
- Run the GUI script:
python “WordleBot GUI.py”- A graphical interface will open, allowing you to interact with the bot.
- The bot requires the
answers.txtandguesses.txtfiles to be in the same directory as the Python scripts. Ensure these files are not moved or deleted. - If you encounter any issues, ensure that you are using Python 3.6 or later.
Feel free to tweak this to match your exact preferences or needs!
You can type the guesses that you made, just like in Wordle (note that the return/enter key does nothing). All guesses must be valid words, or else you will not be able to click the 'Calculate' button (which calculates the best guess).
The Guesses and Guesses Remaining columns on the right show the top 17 best guesses and the expected number of guesses needed to solve the puzzle for each one. Green guesses are possible solutions. The Solutions column on the left indicates all remaining solutions to the puzzle.
For valid guesses, you can click on the tiles to cycle their color between black, yellow, and green.
If it seems to be taking forever (longer than 2 minutes) to calculate the best guess, it may be the case that you made an objectively terrible guess, or you just got unlucky and ended up eliminating very few words.
Note that all the contenders for the best guess are calculated at once (using threads), so you may have to wait over a minute for that progress bar to stop displaying 0% (which usually happens when the hint revealed is ⬛️⬛️⬛️⬛️⬛️).