> It seems like many of the variables are given names that are not descriptive at all to make it a bit more difficult to read.<p>The code is just minimized for prod..<p>The article as written makes it sound like the developer(s) intentionally wrote their code cryptically, whereas minimization for deployment is fairly standard practice
A word of warning for anyone inspecting the Wordle source code: the answers for each day are stored in a list ordered by day. If you search for today's answer, the next word in the list will be tomorrow's answer, etc. Be careful not to ruin the fun by seeing tomorrow's answer in advance!
> var Ha = new Date(2021,5,19,0,0,0,0);
> My assumption is that this is the launch date for Wordle<p>But not 19th of May 2021, but 20th of June 2021<p>Every time I look as JavaScript, I find a new reason to hate it.
I figured that was possible; from the UX it was pretty clear it’s all client side.<p>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
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 <i>tomorrow’s</i> challenge ruined for me by a technical blog post.
I made a little change that allowed setting the day's puzzle based on puzzle ID number via a query parameter so you could play previous day's puzzles. Here's the gist with relevant code block if anyone's curious: <a href="https://gist.github.com/antoniomika/5ec4741d309cc829a5bc26a53c4089f3#file-main-db1931a8-js-L14435-L14455" rel="nofollow">https://gist.github.com/antoniomika/5ec4741d309cc829a5bc26a5...</a>
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.<p>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.<p>Your progress is just stored in local storage. You can blow your data away by deleting it via dev tools.<p>My version just lets you try again by refreshing, I'm not storing any data.<p>The viral factor of the original Wordle, IMO, is the share function and the little emoji grid it generates.<p><a href="https://alexmj212.dev/word-guess/" rel="nofollow">https://alexmj212.dev/word-guess/</a><p>Source: <a href="https://github.com/alexmj212/word-guess" rel="nofollow">https://github.com/alexmj212/word-guess</a>
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?<p>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?!"
This was good while my wife and I were in the same time zone: we compared guesses and how we got there. Now that she's a day ahead, we can't do that right now (we found this out when she accidentally did a spoiler).
I actually did the same thing a week or so ago, but in a more readable format: <a href="https://gist.github.com/lc-nyovchev/c42f09a48364665da26342598bb7d29f" rel="nofollow">https://gist.github.com/lc-nyovchev/c42f09a48364665da2634259...</a><p>And
<a href="https://ath3nd.wordpress.com/2022/01/11/about-wordle/" rel="nofollow">https://ath3nd.wordpress.com/2022/01/11/about-wordle/</a><p>The idea with the game is to have fun, not to make it impenetrable for techies (in which case a backend would have been nice)
Fun times. I remember back in the year 2000, during the dot com craze, there was a company in India that built a clone of "Who wants to be a millionaire". It was in beta and there was no real cash or prize involved.<p>They had all the answers stored in the source code. I wrote up a quick perl script to play the game and unfortunately left it running overnight, and in the morning there were complaints from other players asking how I'd reached the top rank so quickly.
I guess I wasn't the only person who tried to reverse engineer wordle because they were stuck on the final try.<p>I thought I would do a programmatic soltion because that was the only win I will be able to get. I did find it interesting that they had all the 5 letter words in the frontend logic.
I liked this deconstruction of Wordle a lot: <a href="https://bert.org/2021/11/24/the-best-starting-word-in-wordle/" rel="nofollow">https://bert.org/2021/11/24/the-best-starting-word-in-wordle...</a>
I'm not sure why you'd want to reverse engineer something that isn't trying to hide anything. Just enjoy playing it!<p>I've seen quite a few blogs/tools all trying to surf the wave of Wordle.