a lot security

Hacking wordle for fun and profit

It really wasn't fun, and there was no profit either. But I was able to show my friends and family members that I was better at wordle than they were and that was worth it for me. When you end this article, you can too.

Knowing the Wordle in advance

The first thing to realize about Wordle is it makes no network calls while you're playing. Everything about Wordle is completely self contained on the webpage when it loads. There's no “back-end”.

That means the wordle execution flow is roughly:

  1. Render the page.
  2. Check the date.
  3. Turn your computer's date into an array index and choose the word
  4. Game logic, draw the board, tell you that you lost

All of the javascript and game logic to run the entire game is stored in a single JS file that is minified, but it's pretty easy to spot the giant arrays containing the words

Next, you need to figure out how the word is chosen and it was pretty easy to isolate to three functions by searching for "Ma", the array name. One of the functions take a date as an argument.

Once I found this, I did some cut and pasting, and made this wordle solver https://github.com/ejcx/wordlesolver

:) node index.js
The wordle of the day is: swill

You can also spoil an entire week for your friends, use these words constantly and eventually your friends will catch on that you are a genius, and somehow are always ahead of the wordle.

:) node index.js week
The wordle for Sat Feb 19 2022 11:33:24 GMT-0600 (Central Standard Time)is: swill
The wordle for Sun Feb 20 2022 11:33:24 GMT-0600 (Central Standard Time)is: tacit
The wordle for Mon Feb 21 2022 11:33:24 GMT-0600 (Central Standard Time)is: other
The wordle for Tue Feb 22 2022 11:33:24 GMT-0600 (Central Standard Time)is: thorn
The wordle for Wed Feb 23 2022 11:33:24 GMT-0600 (Central Standard Time)is: trove
The wordle for Thu Feb 24 2022 11:33:24 GMT-0600 (Central Standard Time)is: bloke
The wordle for Fri Feb 25 2022 11:33:24 GMT-0600 (Central Standard Time)is: vivid

If you aren't a nerd and just want to do it the easy way, you can also just change your computer's clock time and play a worlde from the future or the past which is way easier.

Making it look like you always win

I told my wife I guess the wordle right on the first try every time. She was impressed. Amazed, even. She couldn't believe it.

Within the chrome application tab in dev console, you can edit these values and make all sorts of funny things happen. Your successes and crushing humiliating failures are stored in localStoage. That's fun too I guess, because it is easy to rewrite your history.

Wordle is fun and representative of a simpler time. You can cheat if you'd like, but you're only ruining it for yourself.

Enter your email address to subscribe