Ejemplo n.º 1
0
        public void SolverTest()
        {
            var singlePossibilitySolverStrategy = new SinglePossibilitySolverStrategy();
            var singlePlaceSolverStrategy       = new SinglePlaceSolverStrategy();
            var bruteForceSolverStrategy        = new BruteForceSolverStrategy();
            var solver = new CombinationSudokuSolver(
                singlePossibilitySolverStrategy,
                singlePlaceSolverStrategy,
                bruteForceSolverStrategy);

            Sudokus.TestSudoku(Sudokus.Easy, singlePossibilitySolverStrategy, solver.ExecuteSolve);
            Sudokus.TestSudoku(Sudokus.Intermediate, singlePlaceSolverStrategy, solver.ExecuteSolve);
            Sudokus.TestSudoku(Sudokus.Difficult, singlePlaceSolverStrategy, solver.ExecuteSolve);
            Sudokus.TestSudoku(Sudokus.Expert, bruteForceSolverStrategy, solver.ExecuteSolve);
        }
Ejemplo n.º 2
0
 public void BruteForceSolverTest()
 {
     Sudokus.TestSudokus(new BruteForceSolverStrategy().Solve);
 }
Ejemplo n.º 3
0
        public void SinglePossibilitySolverTest()
        {
            Assert.That(SinglePossibilitySolverStrategy.GetPossibilities(Sudokus.Easy.Sudoku, 7, 8).Single(), Is.EqualTo(7));

            Sudokus.TestSudoku(Sudokus.Easy, new CombinationSudokuSolver(new SinglePossibilitySolverStrategy()).Solve);
        }