Wow! Thanks for the dictionary link. I have a game I've been working on that I originally wrote in VBA (on top of MS Access) and used the microsoft dictionary tools. It was the only language I knew, but like, a pointless endeavor since there is no way to monetize something that requires a person own an expensive database application in order to play it. So now I'm learning
Java and will redo the project.
OK, back to the question about the searches.
The only thing I can think of is to do an exhaustive tree search through the grid. To do the search, each square should be an object that has a hardcoded list of neighbors that can be searched progressively. (The list of neighbors should have a FAST iterator or use a very efficient For:Each.) Each square will also have to have a boolean to "mark" it as part of the current
word search so that you don't back track onto yourself. I'd make each list of "neighbors" as similar as possible, for example, starting at 12:00 and going clockwise. With each step into the tree you have to look up the word. As long as you are still forming a word, you continue with the tree. As soon as you hit a letter that makes your
string something that is not either a word or not a part of a word, you backtrack and continue clockwise to the next neighbor. I suspect that you'll want to go depth-first in this situation.
Example:
STAR (is a word, continue) START (is a word, continue) STARTL (is part of a word, continue) STARTLP (not a word, backtrack)
Note: the search through the dictionary on this branch is forward only, and the words are close together. So there are undoubtably some efficiencies there! For example, after STARTLE I have STARVATION, with nothing inbetween, but LP is inbetween LE & V, so therefore STARTLP can NOT be a word or part of a longer word.
Anyway, the main point is that if you start with the grid and look up possible words, I think you'll have a lot less looking up to do than if you start with the dictionary and try to find each word of it in the grid.
Have you played at
http://www.wordsplay.net? I love this game!