vendredi 26 août 2022

Python Library for Finding the Most Optimal Combination of Words

I was working on a project because I was bored. Most people have heard of Wordle, but I like to play Quordle, which is the same thing, except you play 4 words at once. You can play it here if you would like (there's also octordle which is even more fun). I was getting bored with easily beating the puzzle with my normal starting guesses, and wanted to make it more interesting for myself.

Anyway, I made a list of every possible 5 letter word, then removed all the words that contained repeat letters (e.g. teeth). So now I'm only left with words that have 5 different letters.

I then randomize the list, and brute forced through the entire 6k+ word list to find a set of starting guesses that have no overlapping letters. Then I use the guesses that appear as my starting guesses. Since it's randomized, it could be 2, 3, or 4 words. Technically, it could be 5, but I've yet to see that through random chance. This makes the game more fun for me.

I like what I've done, but I was wondering if there was a way to find the most optimal 5 word combination, which would result in 5 guesses with 25/26 letters of the alphabet used. I'm sure there's some ML libraries I could use to approach this problem, but I have no idea where to start with the 100,000+ libraries to chose from.

Here is the code to the randomizer. I'm also open to suggestions on improving my existing code, I'm sure there's a more pythonic way of doing things.




Aucun commentaire:

Enregistrer un commentaire