Friday, March 11, 2022

Wordle Hints with Python


I'm pretty sure you must have tried at least once to play this daily vocabulary puzzle. I prefer to not remember the dictionary and I also don't enjoy coding. Voila!
I married them both, my inadequate vocabulary & apparent lack of interest in coding. Then, we get a union to rescue me everyday with hints for guessing the next word.

Let's talk about the approach. For Python Code, see at the end of the post.
You need to start with a guess. Till this point you just know that it's a five-letter word. Not much of a help.
If you follow 3Blue1Brown, 'SALET' is the best first guess as it gives the most information for first guess.

After, that our Python code does the rest.
We load NLTK library, to get the list of words. From that we refine it to 5-letter words. Further, we need to harmonise the case.

This gives us around 9000 words. 

Then, each guess on the Wordle gives you 3 hints:
1. Is the letter present/absent
2. Is the letter at the correct position
3. Is the letter going to be used just once or more

After, that any person with reasonable coding skill can tame the game.
Here is the code : Github Link and the videos below





PS : Sorry, for spoiling the fun!

No comments:

Post a Comment