WordleSolver - A solver for the popular word game Wordle

WordleSolver

This is a solver for the popular word game Wordle.

How to use the solver

Download the executable for your platform and run it by double clicking it. This is a command line application, so a CLI should automatically open.

You should be met with this screen:

Calculate best guesses ...

Now every word in the word list is scored against each other word, to find the best possible guess. This can take a few seconds (~10s on my machine).

Calculate best guesses from given word list ...
Best guesses: [AESIR REAIS SERAI AIERY AYRIE ARIEL RAILE ALOES REALO STOAE ANOLE AEROS]
Your guess:

Now choose one of the guesses, and type it into wordle. Wordle then gives you a score for your guess (green = [H]it, yellow = [h]it, grey = [.]). Now input the guess and the score of your guess into the solver.

Calculate best guesses from given word list ...
Best guesses: [AESIR REAIS SERAI AIERY AYRIE ARIEL RAILE ALOES REALO STOAE ANOLE AEROS]
Your guess: AESIR
Score of the guess: .h.h.
Best guesses: [CLINE LINTY TINED ALINE ANILE CLINT CLIPE INCLE LIGNE LINCH LINED LINTS]
Your guess: CLINE

It immediately shows you the best subsequent guesses, to reduce the search space even more.

Calculate best guesses from given word list ...
Best guesses: [AESIR REAIS SERAI AIERY AYRIE ARIEL RAILE ALOES REALO STOAE ANOLE AEROS]
Your guess: AESIR
Score of the guess: .h.h.
Best guesses: [CLINE LINTY TINED ALINE ANILE CLINT CLIPE INCLE LIGNE LINCH LINED LINTS]
Your guess: CLINE
Score of the guess: h.hhH
Best guesses: [CHEMO CHEMS CHEWS CHEWY HAEMS HAWMS HIEMS MAHWA MANEH MENSH MINCY MYNAH]
Your guess: CHEMO
Score of the guess: h.h..
The solution is: WINCE

Either one of those guesses is already the solution or the solver shows you the last possible remaining word at the end.

How it works

It is basically a simplified version of Minimax.

For every word (guess) a hashtable is created by iterating over every other word (solution) and scoring them against each other, e.g., score(guess="AESIR", solution="WINCE") -> ".h.h.".

The hashtable uses the score as the key and the number of times the score comes up as the value.

The maximum value in this hashtable is then used as the weight of the guess.

To produce the list of best guesses, the words are then sorted by their weights.

This effectively sorts the words, by how much they reduce the search space in the worst case.

After each guess, the possible solution words are filtered until only one word is left, which has to be the solution.

Unfortunately, this approach has a time complexity of O(n^2), which is why the search for the solution takes several seconds.

Similar Resources

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

Dec 16, 2021

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

Dec 2, 2021

RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

Jan 5, 2022

Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

Jan 17, 2022

A dead simple 2D game library for Go

A dead simple 2D game library for Go

Ebiten (v2) A dead simple 2D game library for Go Ebiten is an open source game library for the Go programming language. Ebiten's simple API allows you

Dec 28, 2022

Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Dec 26, 2022

Go 3D Game Engine

Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

Jan 9, 2023

A Game Server Skeleton in golang.

A Game Server Skeleton in golang.

A game server skeleton implemented with golang. 注意(NOTICE) 欢迎加入QQ群: 459420581 (Gopher成都,讨论一切与go有关的话题) gonet/2 gonet1已停止维护(I no longer maintain this, p

Dec 26, 2022
An implementation of the popular game Codenames created with Go and React.

OpenCodenames A real-time implementation of Codenames created with React/TypeScript and Golang. You can play the game here! Installation Stack: React

Aug 8, 2021
Szozat - The Szózat is hungarian version of the Wordle game

Szozat The Szózat is hungarian version of the Wordle game. This is a CLI to help

Feb 5, 2022
Simple word guessing game written in golang.
Simple word guessing game written in golang.

Word Guessing Game Simple word guessing game written in golang. successTexts := []string{ "You guessed right! ????????", "Correct! ✅", "Horray!

Oct 19, 2021
Kurikaeshi is a simple CLI word challenge game written in Go
Kurikaeshi is a simple CLI word challenge game written in Go

Kurikaeshi (繰り返し) Learn you Japanese good through repetition. Kurikaeshi is a simple CLI word challenge game written in Go. It's meant for practising

May 16, 2022
A creativity challenging word game to play with friends.

Friend Fest A creativity challenging word game to play with friends. Process Phase 1: Role Assignment Every player is given a unique number from (0, N

Feb 10, 2022
Implementation of a popular graphics benchmark written on Ebiten.
Implementation of a popular graphics benchmark written on Ebiten.

Ebiten Bunny Mark This is an implementation of the popular graphics benchmark written on Ebiten. The initial benchmark was created by Ian Lobb (code)

Dec 7, 2022
Impress your friends with your ability to maybe solve the Wordle most of the time (probably)

wordle-assistant Impress your friends with your ability to maybe solve the Wordle most of the time (probably). This was coded as quickly and dirtily a

Feb 10, 2022
Arkanoid game in Go using Ebiten game engine with ECS.
Arkanoid game in Go using Ebiten game engine with ECS.

Arkanoid-go Arkanoid game in Go using Ebiten game engine with ECS. You must have Git LFS installed when cloning the repository to download assets. See

Oct 9, 2022
AircraftWar - a game powered by Go+ spx game engine
AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download thi

Jan 5, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022