Live data from Hacker News

Adversarial Wordle

qntm.org

51–60 of 72 posts

Re: Adversarial Wordle

#51

This is great! A few days ago, I wrote a Wordle solver in C. It selects a word to minimize the number of words assuming the worst-case green/yellow. So, it sounds like these two are in direct conflict. My solver is deterministic, and it looks like the adversarial is too, so they always play the same game: S E R A I (0 green, 0 yellow, 429 words remain) M O L D Y (1 green, 0 yellow, 35 words remain) C E N T U (0 greem…

I've written a Wordle solver in F#. It's interesting because your first word contains the five most probable letters. My solver starts off by selecting, at random, one of the possible words that have these five letters.

Could you say more how you've determined your solver to be deterministic in 6 steps?

Also, I'm not sure I understand what this means:

> It selects a word to minimize the number of words assuming the worst-case green/yellow.

Particularly the part "assuming the worst-case green/yellow". Do you mind elaborating?

Re: Adversarial Wordle

#54
My simple 12 line solver maintains a list of rejected letters, letters that must be contained and constraints on form (where letter must be and where letters cannot be). There was an additional step where words are weighted by spelling distance before sampling but this usually results in minute and more often no adjustments. This was meant for regular worldle. Works in 5 - 8 (often 6) guesses for adversarial wordle. Example runs:

    F I L L S (0 green, 0 yellow)
    W H E R E (0 green, 0 yellow)
    D O U B T (0 green, 0 yellow)
    M A N N A (3 green, 0 yellow)
    C A N N Y (4 green, 0 yellow)
    N A N N Y (5 green, 0 yellow)

    A L L O Y (0 green, 0 yellow)
    F E T C H (0 green, 1 yellow)
    I N D E X (0 green, 2 yellow)
    P R I Z E (3 green, 0 yellow)
    B R I B E (3 green, 0 yellow)
    G R I M E (5 green, 0 yellow)

Re: Adversarial Wordle

#55
post #51

This is great! A few days ago, I wrote a Wordle solver in C. It selects a word to minimize the number of words assuming the worst-case green/yellow. So, it sounds like these two are in direct conflict. My solver is deterministic, and it looks like the adversarial is too, so they always play the same game: S E R A I (0 green, 0 yellow, 429 words remain) M O L D Y (1 green, 0 yellow, 35 words remain) C E N T U (0 greem…

I've written a Wordle solver in F#. It's interesting because your first word contains the five most probable letters. My solver starts off by selecting, at random, one of the possible words that have these five letters. Could you say more how you've determined your solver to be deterministic in 6 steps? Also, I'm not sure I understand what this means: > It selects a word to minimize the number of words assuming the w…

So, my algorithm is deterministic because there isn't any random element in it. And then it appears the adversarial doesn't either because the game plays out the same way every time.

So, to generate a single guess, the algorithm will basically try every single word in the dictionary against every possible remaining word. For any given guess, it tracks the count of various possible scorings. The scorings are the positions of greens, and yellows for a total of 243 possible scorings. After looping through all possible remaining words, it finds the max occurrence count within the scoring array. That maximum count becomes that guess's overall utility. It then finds the overall guess that minimizes that utility. (See: https://en.wikipedia.org/wiki/Minimax) After typing this all out, I feel like I didn't do a great job explaining, so let me know what you think.

Re: Adversarial Wordle

#58
post #44

Earlier quoted context omitted.

It's very possible we don't have the same dictionary! I have 8938 words. I confirmed that NARES, DOILY, and TOUCH are in my dictionary. My analysis shows that SERAI's worst-case is 461 words and NARES would have 578. I found my code a bit difficult to debug at the end because it's still halfway decent at playing wordle. So, I fully admit I might not be doing it right! But one thing I also did was allow it to pick a w…

It's worth noting that there are two dictionaries used in this implementation: "possibleWords" (from which the solution can be drawn) and "impossibleWords" (other words that are valid guesses). https://qntm.org/files/wordle/words.js These are most likely the same words in the implementation at https://www.powerlanguage.co.uk/wordle/ based on ["cigar","rebut","sissy","humph","awake","blush","focal","evade", showing up…

[deleted]

Re: Adversarial Wordle

#59
post #44

Earlier quoted context omitted.

It's worth noting that there are two dictionaries used in this implementation: "possibleWords" (from which the solution can be drawn) and "impossibleWords" (other words that are valid guesses). https://qntm.org/files/wordle/words.js These are most likely the same words in the implementation at https://www.powerlanguage.co.uk/wordle/ based on ["cigar","rebut","sissy","humph","awake","blush","focal","evade", showing up…

Good point! And it's clear to me that this isn't the dictionary I was using. I grabbed a random Scrabble dictionary online and filtered for length of five. I'll rework my code to take all this into account and we'll see what happens (it probably will happen later today.)

Okay! It's been reworked with all of this new information, so it knows what words are possible. And I also had it output what it would consider to be the worst-case scoring and it matches the adversarial's scoring! Here's what I get now:

    R A I S E (0 green, 0 yellow, 168 words remain)
    B L U D Y (1 green, 0 yellow, 13 words remain)
    C O U N T (2 green, 1 yellow, 2 words remain)
    V O U C H (4 green, 0 yellow, 1 word remains)
    P O U C H (5 green, 0 yellow, 0 words remain)
Post reply on HN