Beispiel #1
0
        private void solverButton_Click(object sender, EventArgs e)
        {
            SudokuSolver _solver = new SudokuSolver();

            var(completedBoard, finishedBoard) = _solver.SolveBoard(_sudoku.sudokuBoard, 0, 0, false);

            if (finishedBoard)
            {
                _sudoku.sudokuBoard = completedBoard;
                FinishSudoku(_sudoku.sudokuBoard);
                SudokuCompleteForm completeForm = new SudokuCompleteForm();
                completeForm.ShowDialog();
            }
        }
Beispiel #2
0
        private void checkAnswerButton_Click(object sender, EventArgs e)
        {
            SudokuSolver _solver = new SudokuSolver();
            var          answer  = _solver.CheckAnswer(_sudoku);

            if (answer)
            {
                SudokuCompleteForm completeForm = new SudokuCompleteForm();
                completeForm.ShowDialog();
            }
            else
            {
                SudokuNotCompleteForm notCompleteForm = new SudokuNotCompleteForm();
                notCompleteForm.ShowDialog();
            }
        }