Saturday, 4 March 2023

Cheating in Wordle

A few years back, I used Processing to examine palindromes in 5-letter English words, in order to explore the Sator Square.

Weird that even random things like that might have re-uses.

Evil uses, that is! Muahahaha!


The popular daily word guessing game Wordle uses 5-letter words, and I already had a ~10000 word dictionary for generating those squares.

You know that annoying moment when there's a couple of letters in place, but alternate words don't come into mind. (Wordle doesn't allow words outside its dictionary.)

Sometimes I cop out and suggest words that already have letters known not to belong to the solution.

But occasionally I can't even come up with a valid English word to fit! All this variety in such a small game is what makes it exciting, I guess.

The "Cheat"

I have no motive to extensively cheat in Wordle, but found it interesting enough to try. I bet there are already similar articles and blog posts elsewhere.

In Wordle, you have to guess the word of the day in five guesses. After typing a suggestion, the app will tell you if correct letters were in correct position (green), or a correct letter was in a wrong position (yellow), and any incorrect letters (grey).

The keyboard view is also updated to reflect the situation, so you'll always see which letters have been used.

Here I have guessed LOWER; then CLIMB, which is stupid as L was already known. Also, at 4th step I forgot that A should feature.

First I make a genuine guess or two, to get an idea what letters there are, what positions they are in, and importantly, which letters are unused. 

There's some common sense about which words are more likely, but as the words are chosen by humans they can also go other ways. It's still usually worth to pick a starting word with no repeating letters. Exhausting the common vowels in two first words might also help.

If the second guess has a correct letter, this together with the bunch of not-present letters, can narrow the possible words in my dictionary to about 10.

If the second guess only reveals a letter, but no location, the list can be still quite long.

I solved the word KIOSK on 19.2.2023, SWEAT on 20.2.2023, RIPER on 22.2.2023 and VAGUE on 23.2.203, improving the program a little each time. SYRUP, WORSE, MOOSE, ABOVE and TREND followed.

Example: Solving VAGUE

On 23rd of February, 2023, I started my guess with TUNES.

I learned that U and E are present but at incorrect positions.
My next guess was IMBUE, showing U and E are at the end.

This was already good enough to run the first routines with.

I set the used letters string as "tnsimb" and word filter at "***ue"

The dictionary is run through so that the word has to match the filter, but not contain any of the used letters. Used letter list doesn't include discovered letters, because the word may have more of these.

This gave me:

value
argue
vague
queue
vogue
rogue
fugue
revue
deque
roque

Deque and roque I suspect would not be plausible Wordle solutions, despite being perfectly cromulent words.

I went with ROGUE as I like Rogue-likes.

This wasn't correct, but gave me G at correct position, so I revised the used letter string to "tnsimbro" and word filter to "**gue".

My dictionary only had these two to offer:

vague
fugue

...from which I picked VAGUE which was correct at step 4. Even if had been incorrect, I would have been right at step 5.

Improvements

I thought at first the filter could be improved by checking how a consonant or vowel can't exist at a particular location. But this probably wouldn't achieve anything, as the dictionary only contains valid words anyway.

A simpler and better addition was to exclude words with letters at positions where they are known not to be, and a requirement for the dictionary words to have these known letters.

Even then the puzzle doesn't become a total pushover, because the first two guesses might not yield anything conclusive and the suggestion list is quite long with dozens of words. Often the way forward is to prefer probable Wordle-style candidates and ignore really obscure words (like the above degue).

Generally the solution is found in the 4th or 5th guess.

After about 10 solved puzzles I was satisfied and stopped doing this.

No comments:

Post a Comment