public Form1() { InitializeComponent(); Buttons = new Button[9,9]; if (Buttons == null) MessageBox.Show("First, the Buttons are empty"); for (int i = 0; i < 9; i++){ for (int j=0; j<9; j++) { Button newButton = new Button(); newButton.Width = 52; newButton.Height = 52; newButton.Left = 50 * i; newButton.Top = 50 * j; Buttons[i, j] = new Button (); Buttons[i, j] = newButton; this.Controls.Add(Buttons[i,j]); } } if (Buttons == null) MessageBox.Show("Buttons are empty"); Generator= new SolutionSudoku(); Solutions = new List<char[][]>(); Solutions = Generator.solveSudoku(); Rand= new Random(); position = Tuple.Create(-1, -1); game_started = false; finished_board = true; }
public Form1() { InitializeComponent(); Buttons = new Button[9, 9]; if (Buttons == null) { MessageBox.Show("First, the Buttons are empty"); } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { Button newButton = new Button(); newButton.Width = 52; newButton.Height = 52; newButton.Left = 50 * i; newButton.Top = 50 * j; Buttons[i, j] = new Button(); Buttons[i, j] = newButton; this.Controls.Add(Buttons[i, j]); } } if (Buttons == null) { MessageBox.Show("Buttons are empty"); } Generator = new SolutionSudoku(); Solutions = new List <char[][]>(); Solutions = Generator.solveSudoku(); Rand = new Random(); position = Tuple.Create(-1, -1); game_started = false; finished_board = true; }