예제 #1
0
        public void TrieSolver()
        {
            var solver = new TrieSolver
            {
                RootTrie = LetterTrieList[DictionarySize]
            };

            Array.ForEach(Boggles, boggle => solver.Run(boggle));
        }
예제 #2
0
        public void Test_TrieSolver()
        {
            var solver = new TrieSolver
            {
                RootTrie = WordBook.Maxi.GetLetterTrie()
            };

            var timer = Stopwatch.StartNew();

            Array.ForEach(_testData.Boggles, boggle => solver.Run(boggle));
            timer.Stop();

            _testOutput.WriteLine($"Duration = {timer.ElapsedTicks}");
        }
예제 #3
0
        public void Check_TrieSolver()
        {
            var solver = new TrieSolver
            {
                RootTrie = WordBook.Test.GetLetterTrie()
            };

            Array.ForEach(_testData.Boggles, boggle =>
            {
                var result = solver.Run(boggle);
                _testOutput.WriteLine($"{solver.ChainCounter} chains");
                result.Words.Count.Should().Be(boggle.Count);
                result.Score.Should().Be(boggle.Score);
            });
        }