Is Wordle always beatable under optimal play?

[BACK]
Is Wordle always beatable under optimal play?
Posted On: June 15, 2023

Is Wordle always beatable under optimal play on easy mode (where you can guess any valid word)?


To put the question more formally, does there exist a deterministic computer program that can play Wordle successfully, without cheating, for every target word? Wordle is a deterministic game besides the hidden target word, and there is a known, finite list of target words, so this question should be decidable. An examination of Wordle's source code shows that there are 2,315 possible target words and 10,657 additional allowed guess words (12,972 total allowed guess words).


Bonus questions.


(These are included in case an answer happens to have them; they are not necessary to answer the question.).


Is the answer different for easy mode (where you can guess any valid word) vs hard mode (where your guess has both be a valid word and match the clues you've been given so far)?


If there is such a program, what is the word it uses for it's first guess? (If the program is deterministic, it should always use the same opener).


What is the worst case performance of an optimal program (ignoring the 6 guess limit if there is no optimal program that always wins)?


Question from user Zags at stackexchange.


Answer:

Wordle is always beatable under optimal play, on both easy and hard modes. This is doable using Knuth's minmax algorithm for mastermind with a curated starting guess tree.


Here is an example program that does so on easy: https://codegolf.stackexchange/a/242412/73123.


This program wins in at most 5 moves despite being suboptimal (at a minimum, the codegolf challenge restricts the guess space to the 2,315 word list when actual Wordle has 12,972 allowed guesses). It uses the starting word "LANCE", along with a curated list for some of the 2nd and 3rd round guesses, and the word that creates the smallest max split for the rest of it's guesses. Its win distribution is:.


Turn 1: 1.


Turn 2: 49.


Turn 3: 871.


Turn 4: 1354.


Turn 5: 40.


Here is an example that wins every game on hard mode: https://gist.github/zags/a093467ee6e71fd35ff849a5b76f22e5.


It's worst case performance is 6 moves, and uses the starting word "CALMS" and if it's a total miss, uses "BENTO"; otherwise, it uses the word that creates the smallest max split, with a small weight for guessing valid answer words over non-answer words. Its win distribution is:.


Turn 2: 94.


Turn 3: 834.


Turn 4: 1120.


Turn 5: 253.


Turn 6: 14.


Answer from user Zags at stackexchange.



[BACK]
Is Wordle always beatable under optimal play?
Posted On: June 15, 2023

Is Wordle always beatable under optimal play on easy mode (where you can guess any valid word)?


To put the question more formally, does there exist a deterministic computer program that can play Wordle successfully, without cheating, for every target word? Wordle is a deterministic game besides the hidden target word, and there is a known, finite list of target words, so this question should be decidable. An examination of Wordle's source code shows that there are 2,315 possible target words and 10,657 additional allowed guess words (12,972 total allowed guess words).


Bonus questions.


(These are included in case an answer happens to have them; they are not necessary to answer the question.).


Is the answer different for easy mode (where you can guess any valid word) vs hard mode (where your guess has both be a valid word and match the clues you've been given so far)?


If there is such a program, what is the word it uses for it's first guess? (If the program is deterministic, it should always use the same opener).


What is the worst case performance of an optimal program (ignoring the 6 guess limit if there is no optimal program that always wins)?


Question from user Zags at stackexchange.


Answer:

Wordle is always beatable under optimal play, on both easy and hard modes. This is doable using Knuth's minmax algorithm for mastermind with a curated starting guess tree.


Here is an example program that does so on easy: https://codegolf.stackexchange/a/242412/73123.


This program wins in at most 5 moves despite being suboptimal (at a minimum, the codegolf challenge restricts the guess space to the 2,315 word list when actual Wordle has 12,972 allowed guesses). It uses the starting word "LANCE", along with a curated list for some of the 2nd and 3rd round guesses, and the word that creates the smallest max split for the rest of it's guesses. Its win distribution is:.


Turn 1: 1.


Turn 2: 49.


Turn 3: 871.


Turn 4: 1354.


Turn 5: 40.


Here is an example that wins every game on hard mode: https://gist.github/zags/a093467ee6e71fd35ff849a5b76f22e5.


It's worst case performance is 6 moves, and uses the starting word "CALMS" and if it's a total miss, uses "BENTO"; otherwise, it uses the word that creates the smallest max split, with a small weight for guessing valid answer words over non-answer words. Its win distribution is:.


Turn 2: 94.


Turn 3: 834.


Turn 4: 1120.


Turn 5: 253.


Turn 6: 14.


Answer from user Zags at stackexchange.



[BACK]

Can you die from an Unknown Location in Slay The Spire? Can you die from an Unknown Location in Slay The Spire?

Posted On: December 17, 2023
I encountered an Unknown Location (aka a ? room) with an option to upgrade 2 cards but would make me lose 16 HP. I encountered this room while I only had 1 hp. If I had taken the upgrade, would the ro...[More]


Is 2 ranks in V.A.N.S. better than 2 ranks in Perception Training? Is 2 ranks in V.A.N.S. better than 2 ranks in Perception Training?

Posted On: September 27, 2023
Let's say I wanted +2 Perception. I could. Put two points into Perception. Put two points into VANS; the second rank gives you +2 Perception. Seems like for 2 points I could have +2 Pe...[More]


How do I get the space shuttle launch in Gameboy Tetris? How do I get the space shuttle launch in Gameboy Tetris?

Posted On: February 12, 2023
I've been playing Tetris on the virtual Gameboy console on my Nintendo Switch. As a kid, with an actual Gameboy, I remember getting to see a space shuttle launch after doing well enough on an A-Ty...[More]


Is there a secret way to get some character skins in Soul Knight? Is there a secret way to get some character skins in Soul Knight?

Posted On: August 19, 2023
I'm quite new to playing Soul Knight, and I find it quite enjoyable and entertaining. I see that there are skins in the game, but I just can't afford to buy one. Is there a secret thing o...[More]


What is the maximum number of tags a mob can have in Minecraft? What is the maximum number of tags a mob can have in Minecraft?

Posted On: February 26, 2023
In minecraft 1.16.1, If you run this command two times: /tag @p add test you will get a message that says, Target either already has the tag or has too many tags. So that means i know there is a limit...[More]


Cannot beat this fight to save my life, help? Cannot beat this fight to save my life, help?

Posted On: March 29, 2025
I’m at the Kethric/Myrkul fight and I am getting my ass beat. Level 8 Warlock main with Shadowheart on support, Karlach as melee, and Gale as range/distraction. .I’ve read the tips, I go free Nigh...[More]


I have just discovered the devs gave Scratch his own tent I have just discovered the devs gave Scratch his own tent

Posted On: April 28, 2024
Question from user SmartTransformingAce at BaldursGate3 at reddit.com.Answer:I have well over 1000 hours in this game - and have only just discovered this.Answer from user SmartTransformingAce at Bald...[More]


Can I tell if an enemy is out of range in Elden Ring? Can I tell if an enemy is out of range in Elden Ring?

Posted On: August 10, 2023
I'm playing as an Astrologer, so my main means of attack is to cast spells from a distance, as I barely do any physical damage. However, I noticed that my spells have a certain range, and firin...[More]


With proper aim can an Ambassador always one-shot a sniper? With proper aim can an Ambassador always one-shot a sniper?

Posted On: January 29, 2023
I'm working on my Skullpluggery achievement for Spy. For a while I thought it was straight-forward -- just point, pause (for accuracy), and fire. Worked everytime, until lately, where my lucky str...[More]


Emperor is completly justified Emperor is completly justified

Posted On: December 30, 2025
Many people treat him like heartless tyrant and view him as hypocrite, tyrant who demands full obedience and blind trust. He does give you the reason to trust him and if you do, you succeed. You survi...[More]