Live data from Hacker News

Reverse engineering Wordle

reichel.dev

51–60 of 67 posts

Re: Reverse engineering Wordle

#51

I figured that was possible; from the UX it was pretty clear it’s all client side. What I would find cool is derivation of the best strategy at any time. Just like blackjack, there should be a “best” move at all times , and it would be cool to measure yourself against that

I made one, not the optimal strategy though, I simply minimized the expected number of possible solutions for the next step. I repurposed my Mastermind solver since it's basically the same game. Just like Mastermind, minimax is probably better than what I did, but it does solve every Wordle in at most 5 guesses, on average 3.4 guesses. https://github.com/jbchouinard/untitled-word-game https://en.wikipedia.org/wiki/Ma…

>it's basically the same game //

Surely it differs from Mastermind (which I might not be remembering well as I didn't like it) in that the answers must be words in the game's dictionary rather than arbitrary colour codes? That seems to change tactics considerably.

Re: Reverse engineering Wordle

#52
post #46

Earlier quoted context omitted.

I'm not easily finding the publication date, but for me the article says tomorrow's word is "query", which was actually the word a couple days ago. If that's what you see, too, then I think it's safe.

Thanks, I came here because I also thought Tomorrow Was Ruined.

It will be if you run the JSFiddle at the end

Re: Reverse engineering Wordle

#53

Earlier quoted context omitted.

I made one, not the optimal strategy though, I simply minimized the expected number of possible solutions for the next step. I repurposed my Mastermind solver since it's basically the same game. Just like Mastermind, minimax is probably better than what I did, but it does solve every Wordle in at most 5 guesses, on average 3.4 guesses. https://github.com/jbchouinard/untitled-word-game https://en.wikipedia.org/wiki/Ma…

>it's basically the same game // Surely it differs from Mastermind (which I might not be remembering well as I didn't like it) in that the answers must be words in the game's dictionary rather than arbitrary colour codes? That seems to change tactics considerably.

I agree it changes the experience of playing the game for a human quite a bit, and you'll use different tactics, but for the kind of solver I made it doesn't change much - I had to change very little code to make it work.

From the perspective of the solver it just means the starting set of potential solutions is every word in the dictionary, instead of every permutation, but it doesn't really make much of a structural difference. Either way a solver can just brute-force its way through every potential solution since there aren't that many.

The other difference is that Mastermind tells you only how many of the pegs are correct, but not which ones. Wordle tells you which ones. That is easier, but it's counterbalanced by Wordle having a larger solution space. There's only 1296 possible solutions for classic Mastermind (4 pegs, 6 colors).

Re: Reverse engineering Wordle

#54
post #46

Earlier quoted context omitted.

I'm not easily finding the publication date, but for me the article says tomorrow's word is "query", which was actually the word a couple days ago. If that's what you see, too, then I think it's safe.

Thanks, I came here because I also thought Tomorrow Was Ruined.

Couldn't be ruined, that's six letters.

Re: Reverse engineering Wordle

#55
Wordle is easy to cheat at. All the validation and past scores are client side, the code and concept is simple, but why would you cheat?

No offense to the author but I am kinda confused why someone would even open the inspector and be like: "how is this being done?!"

Re: Reverse engineering Wordle

#56

I rebuilt Wordle from scratch using the same word list. There are actually two word lists, one from which they select the answer, and another from which they validate real words. They are just arrays of strings hardcoded in the JS bundle. When you submit a guess, it checks to see if your guess is in either array (or at least that's how I implemented it). And just does some relatively simple string comparison. Your pr…

Nice port! However it's not letting me re-use a guessed letter, which makes it way harder to guess the answer

Re: Reverse engineering Wordle

#57

I figured that was possible; from the UX it was pretty clear it’s all client side. What I would find cool is derivation of the best strategy at any time. Just like blackjack, there should be a “best” move at all times , and it would be cool to measure yourself against that

I haven't implemented the best strategy at _all_ times, but this blog post[0] proposes a strategy (pick the word that minimizes the expected-size of the resultant set of possible answers). I made a User Script[1] that tells you how many words remain after each guess - it shouldn't be too hard to expand that to tell you a) what the expected answer-set-size was with your answer, and b) how that compares with the "best" answer.

[0] https://blog.scubbo.org/posts/cheating-at-word-games/ [1] https://blog.scubbo.org/posts/cheating-at-word-games-part-3/

Re: Reverse engineering Wordle

#58

I rebuilt Wordle from scratch using the same word list. There are actually two word lists, one from which they select the answer, and another from which they validate real words. They are just arrays of strings hardcoded in the JS bundle. When you submit a guess, it checks to see if your guess is in either array (or at least that's how I implemented it). And just does some relatively simple string comparison. Your pr…

>> The viral factor of the original Wordle, IMO, is the share function and the little emoji grid it generates.

Yes, that is really genius. That's what made me to wonder what this game was about.

Re: Reverse engineering Wordle

#59
post #35

This is an unusual thing to find myself typing in a HN thread, but this could use a spoiler tag, as I did not expect to have tomorrow’s challenge ruined for me by a technical blog post.

I really wish Wordle would release the daily puzzle where everyone can do it at the same time.

Re: Reverse engineering Wordle

#60

Wordle is easy to cheat at. All the validation and past scores are client side, the code and concept is simple, but why would you cheat? No offense to the author but I am kinda confused why someone would even open the inspector and be like: "how is this being done?!"

> I am kinda confused why someone would even open the inspector and be like: "how is this being done?!"

Kids these days.

When I was young I would disassemble anything with a circuit board. The Nintendo, the garage door opener... parents drew the line at the VCR though.

Post reply on HN