..

Wordle Trainer

I first heard of wordle thanks to some friends on Discord and initially brushed it off, but as it started to get more popular, I decided to try it out. After finishing the first game with 6 attempts, I straightened my invisible grey hat and fired up the network inspector. During the game not much was happening - clearly the whole thing was client side.

Thankfully the original author wrote the javascript very nicely which made reading it a pleasure. Jumping around a bit, I found a word of interest - “solution”. Hopping around a bit more led me to the logic which evaluated the user input. The actual character matching is fairly straightforward - what I was interested in is where it got the solution from.

Solution in the source

Turns out, there is some fancy logic indeed for choosing the day’s solution from the value of the date and a predetermined list of words, present as an array in the javascript code. But the convenient part is - the script will load the correct word and store in as part of the “game state” - which is a JSON object in local storage.

Local storage

By executing some javascript which loads the string from local storage and parses it, we can extract the solution and alert it so the user knows the answer right away. And that’s exactly what my chrome extension does!

Solution

Check it out on the Chrome Store!

Of course, it is completely open source and available on Github as well

Questions?

I would be happy to answer any questions you have! You can contact me via email, and please use my PGP key to encrypt all communications.