# They gave away the wordle when they shared the colors! What was it?

Wordle is a game in which you have to guess a 5-letter word. Here's a snip from the New York Times website:

Judging the letters is done from left to right. So here is an example that I think covers the corner cases:

One of the features of this game is that you can share your game result with the letters hidden. The idea being that you can see how many turns the person took, and which letters they got right etc.

It got me wondering if there were situations in which the color coding would uniquely specify the answer. And possibly even the guesses.

The first of these turns out to have many solutions. And the second does also. If this game is of interest to the community, I could share more of them, or maybe search for examples with other restrictions. For example, it could be a restriction that the game is played with the strict rules which require you to use letters you've already guessed.

But let me start with two examples, one of which (should) specify the guesses as well as the answer, and the other of which you can deduce the answer even if you can't get all the guesses.

What are the words behind this wordle game?

What is the answer to this wordle game? If I tell you that the first letter of the 3rd word is "C", you can also figure out all the guesses.

Here is a link to a list of valid 5-letter words (you'll need both sets).

The first word is:

RISEN

And the four other guesses are:

RINES
RESIN
SIREN
RINSE

The second word is:

VALUE

And it's other four guesses are:

VOLAE
VELUM
CALVE
VAUTE

I didn't use any fancy tricks; I just ran it through this code, which found the words for me:

let patterns = [[1, 'x', 3, 2, 5], [1, 5, 3, 4, 'x'],['x', 2, 3, 1, 5], [1, 2, 4, 'x', 5]]; // transcribed version of the results
const toWord = (pattern, word) => pattern.map((e, i, arr) => e == 'x' ? [^\${arr.filter(e => e != 'x').map(e => word[e-1]).join}] : word[e - 1]).join;

let word;
let foundWords = {}
for(word of word_list){
let foundGuesses = []
let flag = true;
for(let pattern of patterns){
let guess = new RegExp(toWord(pattern, word));
let found = guess_list.find(e => guess.test(e))
if(!found) {flag = false; break;}
foundGuesses.push(found);
}
if(flag){
foundWords[word] = foundGuesses
}
}
console.log(foundWords)


I did have to manually determine which of two words the first word was, and apply the constraint to the second word, but it made it significantly easier.

For those of you that don't understand code:

• It searces through the valid words list, then:
• For each row in guess results pattern, it:
• Tries to make the valid guess, and checks that guess
• Moves on to the next end word if the guess isn't a valid guess, or:
• Checks the next result pattern
• At the end, it prints out all of the valid final words.
• For anyone doing today's wordle, it was a total coincidence! Commented May 4 at 15:36
• Great job. And very quick. Nicely done. Commented May 4 at 15:37