Live data from Hacker News

Reverse engineering Wordle

reichel.dev

21–30 of 67 posts

Re: Reverse engineering Wordle

#21
I'm not sure why you'd want to reverse engineer something that isn't trying to hide anything. Just enjoy playing it!

I've seen quite a few blogs/tools all trying to surf the wave of Wordle.

Re: Reverse engineering Wordle

#22
post #18
post #7

> 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. The code is just minimized for prod.. The article as written makes it sound like the developer(s) intentionally wrote their code cryptically, whereas minimization for deployment is fairly standard practice

How common is it to have your minifier change symbol/variable names to short ones?

It is pretty common. The goal of the minifier is to reduce the size of the file, so taking the function names, variable names, etc and making them as short as possible works towardd that goal

Re: Reverse engineering Wordle

#23

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!

You can also see the solution and various other points of pertinent data stored as a JSON string in your localStorage without having to dive into code.

Re: Reverse engineering Wordle

#24
post #18
post #7

> 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. The code is just minimized for prod.. The article as written makes it sound like the developer(s) intentionally wrote their code cryptically, whereas minimization for deployment is fairly standard practice

How common is it to have your minifier change symbol/variable names to short ones?

I just popped open DevTools on an SPA I made using create-react-app with default settings. Sure enough the minified production JavaScript uses shortened variable names. This is default configuration for Webpack, which is pretty widely used throughout (and outside) the React ecosystem.

Interestingly you can still view the unminified source, since create-react-app generates source maps by default.

Re: Reverse engineering Wordle

#25
post #18
post #7

> 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. The code is just minimized for prod.. The article as written makes it sound like the developer(s) intentionally wrote their code cryptically, whereas minimization for deployment is fairly standard practice

How common is it to have your minifier change symbol/variable names to short ones?

Pretty much all of them do it. You can’t minify keywords or literals, so that just leaves whitespace, which would be barely any minification at all.

Re: Reverse engineering Wordle

#26
post #18
post #7

> 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. The code is just minimized for prod.. The article as written makes it sound like the developer(s) intentionally wrote their code cryptically, whereas minimization for deployment is fairly standard practice

How common is it to have your minifier change symbol/variable names to short ones?

That's literally what they are for.

Re: Reverse engineering Wordle

#27

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/Mastermind_(board_game)#Best_s...

Re: Reverse engineering Wordle

#29
> var Ha = new Date(2021,5,19,0,0,0,0); > My assumption is that this is the launch date for Wordle

But not 19th of May 2021, but 20th of June 2021

Every time I look as JavaScript, I find a new reason to hate it.

Re: Reverse engineering Wordle

#30
post #29

> var Ha = new Date(2021,5,19,0,0,0,0); > My assumption is that this is the launch date for Wordle But not 19th of May 2021, but 20th of June 2021 Every time I look as JavaScript, I find a new reason to hate it.

Only 50%; the month is zero-indexed, but the day isn't.
Post reply on HN