Friday, January 07, 2022

Wordle Solving For Fun and Coding

After my post the other day (Is Wordle A Project To Assign Students to Program?) I got thinking about solver help for Wordle. I happen to have a huge word list I got some somewhere some time ago. For various reasons I had written a program to make sub list files of words of a specific length. So of course I have a list of 5 letter words – something over 8,000 of them. So that is a start.

Phase one of my program was to find all the words that had a specific letter in a specific location. That narrows things down a bit was not near enough. Phase two was to ignore words that had specific letters which I knew were not in the correct answer. That was very helpful.

If I don’t know where any letters were I was not getting close enough. So I added a method to include all words that had specific letters in any position while ignoring words with specific other letters.

You would be surprised at how many 5 letter words have the same five letters but in different position by the way. On the other hand if you get enough information about what letters to exclude, what letters to include, and one or more letters with a specific location than finding the answer is pretty easy.

This was a fun (for me anyway) coding exercise. Will it be fun for students? I have no idea. Let me know if you have an opinion or try it with students.

No comments:

Post a Comment