public static int Print_All_Solutions(Helfer.Matrix <int> matrix)
        {
            Stack <int> last = new Stack <int>();
            int         i    = 0;

            while (Sudoku_Check.ValidateSudoku(matrix, last, -1) && i <= MAX_COUNT_BEFORE_EXIT)
            {
                i++;
            }
            return(i);
        }
Пример #2
0
        public static int Check_For_Mutliple_Solutions(Helfer.Matrix <int> matrix)
        {
            Stack <int> last = new Stack <int>();

            if (!Sudoku_Check.ValidateSudoku(matrix, last, 0))
            {
                return(-1);                                               // Check if Valid
            }
            Console.WriteLine("");
            Console.WriteLine("----------------------------");
            Console.WriteLine("");
            if (Sudoku_Check.ValidateSudoku(matrix, last, 0))
            {
                return(1);                                              // double Solution
            }
            else
            {
                return(0);
            }
        }