public void SolveTest(KnownWords knownWords, UnknownWord unknownWord, int[] subWordCount, string expectedWord)
        {
            var crossword = new CrosswordPuzzle(knownWords);
            var solutions = crossword.Solve(unknownWord, subWordCount);

            Assert.That(solutions, Has.Member(expectedWord), "expected word was not in the list of solutions");
        }
Beispiel #2
0
        public static void CrosswordMenu(KnownWords knownWords)
        {
            Console.WriteLine($"Enter what you know about the word with {UnknownWord.UnknownToken} for missing characters:");
            var wordPattern = _ReadUnknownWord();

            Console.WriteLine("If there is more than 1 word enter the letter count of each word followed by space, if 1 word just ENTER.");
            Console.WriteLine("Example: if the solved clue is THATSALLFOLKS then the letter counts to type are '5 3 5':");
            var subWordCount = _ReadSubWordCount();

            var crosswordPuzzle = new CrosswordPuzzle(knownWords);
            var answers         = crosswordPuzzle.Solve(wordPattern, subWordCount).ToList();

            Console.WriteLine($"There are {answers.Count} possible solutions:");
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }

            SolveMoreOrQuit(knownWords);
        }