Untangle - A helper for Wordle-style puzzles

Since being released in late 2021, the game Wordle seems to have taken the Internet by storm, spawning a host of similar games such as Dordle, Quordle, Octordle and Sedecordle, each of which presents a number of Wordle-like instances to be solved together.

In this post, we'll look at Untangle, a tool which helps in solving these puzzles.

The puzzles all consist of one or more instances of a word game based on the Mastermind model. Each instance has a secret five-letter word which has to be identified correctly within a fixed number of attempts (guesses). That number depends on the type of game:

Game

Instances

Attempts

Wordle

1

6

Dordle

2

7

Quordle

4

9

Octordle

8

13

Sedecordle

16

21

After each guess, the game gives you clues to help you solve the puzzle. A letter which is in the secret word but not in the correct position is marked in yellow, whereas a letter which is in the correct position is marked in green. Unmarked letters are not in the secret word at all. After each guess, you can use these marks as clues to get you closer to the secret word.

How can a tool help?

Let's see how a tool can help in solving these puzzles. What are the problems one might need help with?

  • There are almost 13,000 five-letter words from which the secret word could be picked, and many of those are pretty obscure. Even a person with a very good command of vocabulary will struggle at times to identify words which might be possible solutions.

  • For the multiple-instance games, one can get carried away trying to solve one of the puzzle instances, but run out of guesses in the overall game. This could easily happen, for example, if one of the secret words ends in -atch or -ound – you could have correctly guessed four of the five letters but still easily run out of guesses. To try to avoid this, you need to focus on all the instances at once so that there are no surprises near the end.

  • In the early stages of a game, you should guess words with distinct letters, in order to get the most information out of each guess. It can be handy to keep track of words with distinct letters, as opposed to words containing the same letter more than once.

Untangle helps with these problems as follows:

  • It maintains a list of those almost 13,000 words. After each guess, you tell Untangle how the actual game has marked your guess, and it works out the remaining possible words based on all of the marks received so far, and displays those possibilities for each puzzle instance in the game.

  • It displays a count of the remaining possibilities for each instance, so that you can focus on the instances for which there are still a lot of possibilities remaining.

  • It allows you to sort the remaining possibilities by words with distinct letters vs. words with repeated letters, so that you can make more helpful guesses in the early stages of a game.

It's perhaps easiest to see how it works through a short (around one minute) video, taken during an attempt to solve the Daily Dordle #0106:

In this case, we got pretty lucky with our guesses. But you should be able to see how Untangle shows the possibilities remaining at each stage for each puzzle instance in the game. Here's a diagram that shows the different parts of the Untangle user interface (for a single puzzle instance):

Untangle UI elements

How does it work?

The approach used by Untangle is simple. Based on the clues given so far, a regular expression is calculated for each letter position indicating which letters can or cannot appear in that position. The expressions for each letter position are concatenated to form a pattern for the entire word. The roughly 13,000 possible words are each matched against the pattern, and those that don't fit are discarded, leaving the rest as possibilities to be displayed. While 13,000 words seems like a lot – and when playing Sedecordle, there are 16 sets of these to be checked – most computers and phones these days have no trouble doing these checks quickly enough to provide responsive feedback to users.

Comments