Scrabble -- find words on board?
I know HOW to find words made on the board... im just not sure what alogithm to use that will work. I've thought of two main ones, neither of which are ideal.
The first is after checking the spot, set a boolean flag to true so that spot is not checked again. The problem with this is that the letter can very well be used in multiple directions to form words.
The second option is to store found words in an array and only add unique ones to it. This is also a problem, because there could be duplicate words.
Any tips or suggestions?
Re: Scrabble -- find words on board?
I?ve actually implemented similar functionality on my website, scrabblwordfinder.uk, which helps players find the best possible words from their tiles. If you?re experimenting with word-finding algorithms, it might give you a good reference for ideas and performance comparisons.
If you?d like, I can also share a C++ or C# code example showing how to combine the Trie and backtracking approach effectively.
Would you prefer that?
Re: Scrabble -- find words on board?