Checking for words, permutations and prefixes
Checking for words manually
Most word checking in Word Game Builder is done through the high-level API, using the WordGamePlayer component and class. However, manual checking of words from a language’s word list is possible. Checking for words can be done using the following methods:
WordChecker.CheckWord and WordChecker.CheckWordAsync are static methods that will use the current language by default. To use WordSet.FindWord and WordSet.FindWordAsync, the WordSet class can be accessed through the wordSet property on a specific WordGameLanguage.
Low-level strings for the WordSet class can be assembled from letter tiles by using the character property on the Letter object returned from ILetterTile.currentLetter. To assemble them from strings, see the WordGameLanguage.GetLetter method.
Ordered vs. permutation checking
Word Game Builder provides an optional ordered parameter for the above methods. If ordered is false, a permutation check is performed on every combination of the letters provided.
Checking for prefixes
Prefix searching allows for the ability to find all words that start with a specific sequence. This is only supported using low level strings. This can be done using WordSet.FindWords or WordSet.FindWordsAsync.
Checking for words with specific lengths
Word Game Builder supports checking for words up to a maximum length. When using the WordChecker class, this can be done with the maxWordLength property. When using the WordSet class, this can be passed as an argument in FindWord/FindWordAsync.
Word Game Builder does not directly support checking multiple lengths of words directly. A word check like this could be very computationally expensive, especially as the amount of words gets longer.
This can be done however, through multiple separate word checks. For example, to find all the possible words (minLength:3, MaxLength:4) in the word SILVER you can manually create all unique combinations (in any order) between 3 and 4 letters, then do permutation checks on each. For example:
SIL, SIV, SIE, SIR, SLV, SLE, SLR, ...
Note that while permutation checks are optimized, there can still be up to several thousand combinations once variable length is factored in.