private void ButtonSolve_Click(object sender, RoutedEventArgs e) { sudoku = new SudokuSolver(GetBoard()); solutions = sudoku.Solve((bool)CheckBoxAll.IsChecked?true:false); if (solutions.Count > 0) { TextBoxElapsedTime.Text = "Solved in " + sudoku.solvingTime.ToString(); UpdateBoard(solutions[0]); if (solutions.Count > 1) { ButtonNextSolution.IsEnabled = true; solutionNumber = 0; } else { ButtonNextSolution.IsEnabled = false; } } else { TextBoxElapsedTime.Text = "There are no solutions :("; ButtonNextSolution.IsEnabled = false; } }
private void ButtonSolveWithoutGuessing_Click(object sender, RoutedEventArgs e) { sudoku = new SudokuSolver(GetBoard()); UpdateBoard(sudoku.SolveWithoutGuessing()); ButtonNextSolution.IsEnabled = false; }