This project aims to provide a readable, efficient and reusable way of solving the Wordle game. The current algorithm is based on the following video from 3Blue1Brown channel. The implementation is short enough (about 10 lines of code). Surprisingly enough, Wordle scoring function is a bit longer. It finds "SOARE" as the best first guess in about 1 second on an mid-range CPU in 2022 and takes less than 3.5 guesses in average to find the solution. It can be easily reused for other guessing games such as Mastermind, Hangman or Guess who?.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Java 16
- Maven 3.6.1
- Git 2.17.1
- Clone the repository from GitHub:
git clone https://github.com/Achaaab/wordle-solver.git
- Build the project with Maven:
cd wordle-solver
mvn package
java -jar target/wordle-solver-x.y.z.jar
========================================================================================================================
SOARE found in 1277ms
score? 01110
27 candidates left
razor, arrow, groan, cargo, arbor, manor, major, croak, organ, baron, armor, radio, rayon, labor, valor, ratio, ...
========================================================================================================================
MARON found in 63ms
score? 11110
1 candidate left
aroma
========================================================================================================================
AROMA found in 46ms
score? 22222
- Try to improve Wordle scoring time with memoization without using too much memory.
- Computes expected information with depth > 1. It seems that "SOARE" is only the 14th best guess with a depth of 2.
I will gladly consider pull requests until Spring 2022. After this date, I could have moved on something else.
- Jonathan Guéhenneux - Developer - Achaaab
This project is licensed under the GNU General Public License (GPL) - see the LICENSE.md for the details.
I thank:
- Grant Sanderson for his interesting videos here and here about Wordle and information theory.