예제 #1
0
        /// <summary>
        /// An example solver to run, should get two possible solutions.
        /// </summary>
        internal static void ExampleToSolve01(int[,] puzzle)
        {
            var solver = new SudokuSolverUsingRecursion();

            //Console.Clear();
            solver.ConsoleWriteGrid(puzzle, "Initial Puzzle");

            solver.Solve(ref puzzle);

            //solver.ClearConsoleToBottom();
        }
예제 #2
0
        static void Main(string[] args)
        {
            var puzzle = new[, ]
            {
                { 5, 3, 0, 0, 7, 0, 0, 0, 0 },
                { 6, 0, 0, 1, 9, 5, 0, 0, 0 },
                { 0, 9, 8, 0, 0, 0, 0, 6, 0 },
                { 8, 0, 0, 0, 6, 0, 0, 0, 3 },
                { 4, 0, 0, 8, 0, 3, 0, 0, 1 },
                { 7, 0, 0, 0, 2, 0, 0, 0, 6 },
                { 0, 6, 0, 0, 0, 0, 2, 8, 0 },
                { 0, 0, 0, 4, 1, 9, 0, 0, 5 },
                { 0, 0, 0, 0, 8, 0, 0, 0, 0 }
            };

            SudokuSolverUsingRecursion.ExampleToSolve01(puzzle);
            SudokuSolver01.ExampleToSolve01(puzzle);
        }