Cheating at Wordscapes

Jackie was playing Wordscapes, the game that has seemingly addicted too many people. I was helping her out for a while, then I decided to, well, cheat.

Cheat using an unlikely tool: Mathematica!

The first command sets up the association with words of certain letters. The second line, the one with “neblit,” is the cheat.

Basically, the wordLookup association has all the words in the language (well, most) and I sort the letters alphabetically for each one. The second line takes the input and similarly sorts it, then takes all possible subsets of letters and checks if they are in the association wordLookup. If they are, it adds them to the result.

The “SortBy,” “Union,” and “Flatten” are just to make the output look nicer.