Ejemplo n.º 1
0
        private static void RunSearch(UnscrambleOptions options, PrefixTreeDictionary dictionary)
        {
            if (options.MinWordLength < 0)
            {
                options.MinWordLength = options.Letters.Length;
            }

            Console.WriteLine("Looking for words...");
            var foundWords = WordFinder.FindUnscrambledWords(
                options.Letters,
                options.MinWordLength,
                dictionary
                );

            if (foundWords.Count == 0)
            {
                Console.WriteLine("Sorry, we didn't find any words :(");
            }
            else
            {
                Console.WriteLine($"Done! Found {foundWords.Count} words:");
                foreach (string word in foundWords)
                {
                    Console.WriteLine(word);
                }
            }
        }