コード例 #1
0
        public void SolveTest3()
        {
            var solver = new Solver();
            var crossword = new MatrixCrossword(2, new[] { "he|ll|o+", "[please]+" }, new[] { "[^speak]+", "ep|ip|ef" });

            bool solved = solver.Solve(crossword);
            Assert.IsTrue(solved);
            Assert.IsTrue(crossword.IsSolved(), "Crossword has not been solved");
        }
コード例 #2
0
        public void SolveTest2()
        {
            var solver = new Solver();
            var crossword = new MatrixCrossword(2, new[] { ".*", ".*", "(a|b)+", "b+" }, new[] { "[^a]+", "(aa|bb)*", "a+b+", "(a|b)*" });

            bool solved = solver.Solve(crossword);
            Assert.IsTrue(solved);
            Assert.IsTrue(crossword.IsSolved(), "Crossword has not been solved");
        }
コード例 #3
0
        public void SolveTest6()
        {
            var solver = new Solver();

            var crossword = new MatrixCrossword(3, new[] { "(t|e|n)*", @"(.)*w+\1", "[lent]*" }, new[] { "(ent|nte|net)*", "[wear]*", "[r-z]e*[m-r]" });

            bool solved = solver.Solve(crossword);
            Assert.IsTrue(solved);
            Assert.IsTrue(crossword.IsSolved(), "Crossword has not been solved");
        }
コード例 #4
0
        public void SolveTest4()
        {
            var solver = new Solver();

            var crossword = new MatrixCrossword(2, new[] { ".*m?o.*", "(an|fe|be)" }, new[] { @"(a|b|c)\1", "(ab|oe|sk)" });

            bool solved = solver.Solve(crossword);
            Assert.IsTrue(solved);
            Assert.IsTrue(crossword.IsSolved(), "Crossword has not been solved");
        }