4 ms·
Since finding a set of possible moves given the current Scrabble board is not quite equal to finding anagrams. To make a move in Scrabble you need to find words
by lifthrasiir 12y ago
Since finding a set of possible moves given the current Scrabble board is not quite equal to finding anagrams. To make a move in Scrabble you need to find words that, for example, have both E and L characters which are separated by two other letters (i.e. /^.{0,}E..L.{0,}$/) when the board contains a row or column with the same pattern (E, followed by two spaces and then L). A simple anagram list cannot efficiently search for such patterns.
- binarymax 12y agoThanks, this makes perfect sense. It probably also accounts for the blank tile in scrabble. Still seems like a hybrid approach could be done to avoid that huge data structure. I'll do some more reading :)
- nathell 12y agoThe thing is that it's not huge. A packed in-memory representation should still be easily traversable and take up less than the space of a plain list of words. See also http://sun.aei.polsl.pl/~mciura/publikacje/lexicon.pdf http://sun.aei.polsl.pl/~mciura/publikacje/lexicon.pdf for more ideas about in-memory lexicon representation.