예제 #1
0
 private static void CompleteSolve(SudokuBoard board)
 {
     Console.WriteLine("Rules:");
     board.OutputRules();
     Console.WriteLine("Board:");
     board.Output();
     var solutions = board.Solve().ToList();
     Console.WriteLine("Base Board Progress:");
     board.Output();
     Console.WriteLine("--");
     Console.WriteLine("--");
     Console.WriteLine("All " + solutions.Count + " solutions:");
     var i = 1;
     foreach (var solution in solutions)
     {
         Console.WriteLine("----------------");
         Console.WriteLine("Solution " + i++.ToString() + " / " + solutions.Count + ":");
         solution.Output();
     }
 }
예제 #2
0
        private static void CompleteSolve(SudokuBoard board)
        {
            Console.WriteLine("Rules:");
            board.OutputRules();
            Console.WriteLine("Board:");
            board.Output();
            var solutions = board.Solve().ToList();

            Console.WriteLine("Base Board Progress:");
            board.Output();
            Console.WriteLine("--");
            Console.WriteLine("--");
            Console.WriteLine("All " + solutions.Count + " solutions:");
            var i = 1;

            foreach (var solution in solutions)
            {
                Console.WriteLine("----------------");
                Console.WriteLine("Solution " + i++.ToString() + " / " + solutions.Count + ":");
                solution.Output();
            }
        }