A tool that can calculate the average solution set for a first guess in the game of Wordle

Overview

word-distances

A tool that can calculate the average solution set for a first guess in the game of Wordle.

Yes, the name isn't great -- I initially had a different idea in mind, but wound up going with a brute-force approch that gives a much better result.

The code currently in the repo can be compiled with javac Main.java. It's only three source files. It takes no input parameters.

How it Works

The point of this tool is to calculate the best first-guess word for the game Wordle. It does this by taking the list of all possible words, and iteratively comparing them against all possible solution words, generating the result guess as it would in the game (i.e.: GREEN, YELLOW, or BLACK).

Using this result, it then applies it as a filter against the solution word list. The total number of remaining words is then calculated. This process is repeated for a single guess word against all possible answer words, increasing the total.

Currently, the output is only this total score. Lower scores are best, as this indicates that under the most situations the guess word results in a lowest number of possible solution words. It's a brute-force search, so the result is exact. You can average the result for each guess word by dividing this total by the number of solution words (currently 2315) -- the word with the lowest average is the best word to start the game with.

Every possible guess word and total score are output to stdout, in CSV format. The best scoring word along with its score is written to stderr at the end of the run.

Expected Runtime

Running through the 30+ million possibilities took around 4h on my 2021 Intel MacBook Pro. Sorry, I forgot to run it against time to get a more exact result, and the computer went to sleep at some point while I was out for the evening, so YMMV.

Results

Full results can be found in results.txt, which is in CSV format and is sorted by word. Import into your favorite spreadsheet program to sort by score, calculate the average, or do whatever other analysis you want to do.

TL;DR results are:

Top 5 Words:

Word Score Average
roate 185067 79.9425485961123
soare 190696 82.3740820734341
raile 197271 85.2142548596112
raise 197781 85.4345572354212
orate 199294 86.088120950324

Bottom 5 Words:

Word Score Average
immix 2197269 949.144276457883
xylyl 2218252 958.208207343413
gyppy 2242976 968.888120950324
jugum 2420774 1045.69071274298
jujus 2504428 1081.82634989201

Basic Analysis

Remember, the average will be the average number of words the solution could possibly be out of the solution word set. So the ideal word would be the one that results in the smallest possible number of words for any possible solution.

The best word is ROATE, which when played averages 79.9 remaining possible words out of 2315. The worst is JUJUS, which will leave you with an average of 1081.8 remaining words out of 2315.

Further Work

With the results calculated here, my next step is going to be to expand the code so that we can concentrate on just the top 10 and bottom 10, and dump the raw results for all guessword-solution combinations. We can then graph their frequency, to get a better idea of their overall effectiveness. Is the average fairly evenly distributed? Are some of the words super-effective against part of the solution set, but super-uneffective against the other half? Lots of questions to be answered here, but it's not worth the computation time to run this for every guessword.

Can this be used to create an optimal solver?

I think so.

Step 1 would be to use the guessword with the lowest overall average ('ROATE'). Step 2 would be to figure out the GREEN, YELLOW, BLACK "score" for this guess, and then use that as a filter against the words in the results currently generated by this code (word-score or word-average).

Step 2 would be to iterate, and pick the lowest remaining total word after the above filtering. This would continue until a solution is found.

Which leads to...

Can we calculate the maximum search depth?

I think so. Using the above optimal solver, we can then run it against all the possible solution words, and calculate how many guesses were required to get the result. Are there any words where this is greater than 6 (the maximum number of guesses in the game)? Stay tuned to find out!

Thanks

Big thanks go out to one of my former professors, WM, with whom I've been enjoying a Facebook correspondance this week to discuss different strategies for scoring the guess words. Her computationally simpler scoring mechanism came up with the words OATER, ORATE, and ROATE, which I've calculated as the 22nd, 5th, and 1st best solutions. Considering hers ran in seconds versus the hours it took to do my calculation I'd say she's found some great starting words!

You might also like...

Snake-Game - A simple snake game written in java.

Snake-Game - A simple snake game written in java.

What's this? A simple snake game written in java. How to play Download the latest release. Ensure that a compatible java runtime is installed (optimal

Oct 31, 2022

Othello PvP (2-Player) Game Application created in Java using Swing and AWT, for playing the Othello game

Othello PvP (2-Player) Game Application created in Java using Swing and AWT, for playing the Othello game

Othello PvP (2-Player) Game Application created in Java using Swing and AWT, for playing the Othello game, a simple game that played on an 8 by 8 checkered board with 64 double-sided black and white discs. The game is easy to learn, but it takes time to master and develop winning strategies.

Feb 28, 2022

The game is a 2D side scrolling system, where a player moves left, right, vertically or diagonally to traverse the game.

The game is a 2D side scrolling system, where a player moves left, right, vertically or diagonally to traverse the game.

The game is a 2D side scrolling system, where a player moves left, right, vertically or diagonally to traverse the game.

Sep 11, 2022

A simple puzzle game made with Unity to practice the game engine

A simple puzzle game made with Unity to practice the game engine.

Mar 30, 2022

A basic representation of the 0-player game, "Game-of-Life", a simple example of basic cellular automata

A basic representation of the 0-player game,

Game-Of-Life-Basic A basic representation of the 0-player game, "Game-of-Life", a simple example of basic cellular automata. A cellular automaton is a

Oct 27, 2022

Cammie's Minecart Tweaks is a mod that makes Minecarts a more viable solution for long-distance transport

Cammie's Minecart Tweaks is a mod that makes Minecarts a more viable solution for long-distance transport

Cammie's Minecart Tweaks Cammie's Minecart Tweaks is a mod that makes Minecarts a more viable solution for long-distance transport. Minecarts can't co

Jul 2, 2022

A set of word-based puzzle games for the CLI while you wait for the build to run

A set of word-based puzzle games for the CLI while you wait for the build to run

Words Words is a set of command line word-based puzzle games. Best way to spend those minutes within the CLI while your build is running ;). But Words

Sep 15, 2022

Fabric mod where anyone can PR anything, concerning or not. I'll merge everything as soon as it works.

Guess What Will Happen In This Fabric mod where anyone can PR anything, concerning or not (no NSFW content). I'll merge everything as soon as it works

Dec 25, 2022

THIS WAS INSANE. CAN WE BEAT MINECRAFT

Fabric Example Mod Setup For setup instructions please see the fabric wiki page that relates to the IDE that you are using. License This template is a

Aug 24, 2021
Owner
null
A program that helps you beat the Wordle game

WordleHelper A program that helps you beat the Wordle game Usage: java -jar WordleHelper.jar [-c [maxTries]] Or just double-click the program icon to

MCUmbrella 7 Dec 8, 2022
WordleCracker - This bot is designed for guessing 5 letter words for the trending game wordle

WordleCracker This bot is designed for guessing 5 letter words for the trending game wordle. The user informs about the status of the game by giving i

Shawon Majid 3 Nov 7, 2022
This script attempts to solve todays Wordle.

Solve Wordle with a Bang! This script attempts to solve todays Wordle.

Max Rydahl Andersen 12 Jul 27, 2022
Wordle Solver - Built With Java Spring Boot + React.js

Get a little Wordle help using information theory.

Miguel Valarao 7 Aug 30, 2022
Prototype of Wordle solving algorithm

AWordle This time you Wordle the program. 'AWordle' stands for 'Automated Wordle' or 'Anti-Wordle', or something else I don't care what you think it i

MCUmbrella 1 Feb 5, 2022
eWordle: an extended version of Wordle with full-featured helper.

eWordle An extended version of Wordle (Mini Project of EBU4201) with full-featured helper. How to Play Guess the Wordle word in tries just one more th

Mingchun 6 Jun 11, 2022
First client that i didin't paste entirely...

BASE(D)BAND External Command Based Utility Player Assistance Mod To open the external command input type "B?" into the ingame chat. Modules live in th

null 9 Sep 24, 2022
A fairly Simple Game made in Java,You can adopt Pets, name them, and take care of them for XpPoints and level up!

Introducing PetGame! A simple console based game made by @denzven in Java ☕ About the Game PetGame is my first big project in Java, the rules are simp

Denzven 11 Jun 7, 2022
My Game Engine tested via my Cubecraft Game

My Game Engine tested via my Cubecraft Game Install: mvn -P {your OS name} clean install mvn -P mac clean install mvn -P linux clean install mvn -P wi

null 30 Oct 3, 2022
BattleShip-Game - This repository contains the code of the BattleShip (Bataille Navale) game programmed in Java.

Bataille Navale Auteur : SABIL Mohamed Amine Comment générer la documentation ? Placez vous dans le sous-dossier src : pour générer la documentation d

Mohamed Amine SABIL 1 Jan 4, 2022