Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private SudokuBoard _board;
- private SudokuSolver _solver;
- private void Form1_Load(object sender, EventArgs e)
- {
- _board = new SudokuBoard(20, 20)
- {
- Text = "Sudoku!",
- Location = new Point(5, 5)
- };
- Controls.Add(_board);
- _solver = new SudokuSolver(_board);
- _solver.GameCompleted += SolverOnGameCompleted;
- }
- private void SolverOnGameCompleted(int numOfTrials)
- {
- MessageBox.Show(string.Format("No. of trials: {0}", numOfTrials));
- }
- private void button2_Click(object sender, EventArgs e)
- {
- _board.ClearBoard();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- _solver.Solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement