I'm currently going through MIT's open courseware course on programming and I'm stuck on this assignment:


(Problem 3)

Basically you have a hand of letters and need to get the computer to make a word from those letters that scores the most points

I have the dictionary mapping the words to their point value but I don't know how I can make the computer pick the best word from my hand ?

Any Ideas ?


So this is basically... similar to Scrabble? So you need two things:

1. Anagram finder to find every possible anagram
2. Simple search of your dictionary to see which anagram results in the most points.

P.S. I'm not a genius on the subject but it seems like you need to generate every possible permutation of your set of letters and for each permutation you generate, check to see if it is in your dictionary, and if so, check to see if it is higher than your current highest word. If so, it becomes the new highest word. I'm suggesting that you look into some open source code to learn about generating the permutations, and what you're looking for is called an anagram.

this also looks potentially useful.