I hope everyone had a great Christmas and New Years (I did!) and that returning to your journeys to work isn’t too bad. And if they are maybe you could do what I used to do on the train every so often, and try to solve a Word Wheel.
After doing a few, and not finding most of the words I thought to myself that solving these with a computer might be a fun exercise. So I set out to do it. And failed. But I did learn a thing or two and also created a very basic Android App that could find anagrams of words:
Then I took a break over Christmas (as you can tell if you check my recent blog posts) and made a crack at creating something to solve the Word Wheels again tonight! And I succeeded! For the most part.
My current implementation as of writing this is quite slow on larger word wheels, larger being those with a total of 9 letters, which is what the majority of newspapers use sadly. But it does work! It just needs some optimisations applied to it.
An example of it’s output for a word wheel that looks like this:
Which we can represent as to sets of characters; one set that are required and another that are optional. In my code I call the required character mustHave and the optional ones canHave. The output from my current code (using a text file I have as a dictionary) outputs this for this example:
acts cast cats act cat sat at as
Which is accurate for this small example.
A bigger (and better) example it works on is the one described on this site. This example’s mustHave is the letter i and it’s mayHaves are: enrdigna. The output from my program for this slightly more complicated example is:
ingrained rending dinner reining earning nearing inaner inner ending inane nine dingier grained reading ringed rained diner earing gainer regain reign rein gained deign dine dirge ridge aider aired dire ride ire aide idea die draining darning raining dining indian anding inn raiding riding daring grind drain rind airing grain grin ring iran rain aiding india din gain gin in rigid gird grid arid raid rid rig air dig aid id
Which is a lot of answers! And they all look correct to!
My next target is to optimise it enough to make a little android app for it.
You can find a github project of my code so far here: https://github.com/LyndonArmitage/WordWheelHelper
I quite enjoyed making it! As always: