Skip to content

Achaaab/wordle-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordle solver

build Coverage License: GPL v3

Description

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?.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Java 16
  • Maven 3.6.1
  • Git 2.17.1

Installing

  • Clone the repository from GitHub:
git clone https://github.com/Achaaab/wordle-solver.git
  • Build the project with Maven:
cd wordle-solver
mvn package

Running

java -jar target/wordle-solver-x.y.z.jar

Example

========================================================================================================================
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

Improvements

  • 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.

Contributing

I will gladly consider pull requests until Spring 2022. After this date, I could have moved on something else.

Authors

  • Jonathan Guéhenneux - Developer - Achaaab

License

This project is licensed under the GNU General Public License (GPL) - see the LICENSE.md for the details.

Acknowledgments

I thank:

About

primitive wordle solver

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages