This program features a nifty recursive algorithm that, given a set of letters, generated every single word those letters could combine to form.
And that’s a lot of words. Assuming certain things (some of which aren’t always true, but this wasn’t bad for fifteen minutes of mostly in-my-head math), 6 letters could form 720 different words, most of which are not valid. That’s not huge, but the combinations grow fast: 8 letters result in 40,320 words (again, mostly invalid words). 12 letters can form 479,001,600 words! To compare, the dictionary this program uses contains 178,590 total valid words.
Which means that my nifty recursive algorithm pretty quickly ran out of memory when dealing with those longer letter strings. This is actually a case where taking a dumber approach was actually better- the final algorithm simply iterates over the dictionary just once, checking whether each word can be formed by the supplied letters. Not too smart, but it actually works better than my original algorithm.
From that second algorithm, this game was born.
Requirements:
· OS: Windows Vista/7
· Java Runtime Environment