Example #1
0
       private void loadPuzzle()
       {
           SudokuPuzzleMaker puzz = new SudokuPuzzleMaker();

           puzz.generate();

           txtGrid1_1.Text = puzz.puzzle[0, 0].ToString();
           txtGrid1_1.Text = puzz.puzzle[0, 0].ToString();
           txtGrid1_1.Text = puzz.puzzle[0, 0].ToString();
           txtGrid1_2.Text = puzz.puzzle[0, 1].ToString();
           txtGrid1_3.Text = puzz.puzzle[0, 2].ToString();
           txtGrid1_4.Text = puzz.puzzle[0, 3].ToString();
           txtGrid1_5.Text = puzz.puzzle[0, 4].ToString();
           txtGrid1_6.Text = puzz.puzzle[0, 5].ToString();
           txtGrid1_7.Text = puzz.puzzle[0, 6].ToString();
           txtGrid1_8.Text = puzz.puzzle[0, 7].ToString();
           txtGrid1_9.Text = puzz.puzzle[0, 8].ToString();
           txtGrid2_1.Text = puzz.puzzle[1, 0].ToString();
           txtGrid2_2.Text = puzz.puzzle[1, 1].ToString();
           txtGrid2_3.Text = puzz.puzzle[1, 2].ToString();
           txtGrid2_4.Text = puzz.puzzle[1, 3].ToString();
           txtGrid2_5.Text = puzz.puzzle[1, 4].ToString();
           txtGrid2_6.Text = puzz.puzzle[1, 5].ToString();
           txtGrid2_7.Text = puzz.puzzle[1, 6].ToString();
           txtGrid2_8.Text = puzz.puzzle[1, 7].ToString();
           txtGrid2_9.Text = puzz.puzzle[2, 8].ToString();
           txtGrid3_1.Text = puzz.puzzle[2, 0].ToString();
           txtGrid3_2.Text = puzz.puzzle[2, 1].ToString();
           txtGrid3_3.Text = puzz.puzzle[2, 2].ToString();
           txtGrid3_4.Text = puzz.puzzle[2, 3].ToString();
           txtGrid3_5.Text = puzz.puzzle[2, 4].ToString();
           txtGrid3_6.Text = puzz.puzzle[2, 5].ToString();
           txtGrid3_7.Text = puzz.puzzle[2, 6].ToString();
           txtGrid3_8.Text = puzz.puzzle[2, 7].ToString();
           txtGrid3_9.Text = puzz.puzzle[2, 8].ToString();
           txtGrid4_1.Text = puzz.puzzle[3, 0].ToString();
           txtGrid4_2.Text = puzz.puzzle[3, 1].ToString();
           txtGrid4_3.Text = puzz.puzzle[3, 2].ToString();
           //REST OF LINE 4

           txtGrid5_1.Text = puzz.puzzle[4, 0].ToString();
           //REST OF LINE 5 HERE
           txtGrid6_1.Text = puzz.puzzle[5, 0].ToString();
           //REST OF LINE 6 HERE
           txtGrid7_1.Text = puzz.puzzle[6, 0].ToString();
           //REST OF LINE 7 HERE
           txtGrid8_1.Text = puzz.puzzle[7, 0].ToString();
           //REST OF LINE 8 HERE
           txtGrid9_1.Text = puzz.puzzle[8, 0].ToString();
           //REST OF LINE 9 HERE
       }
Example #2
0
       private void loadPuzzle()
       {
           SudokuPuzzleMaker puzz = new SudokuPuzzleMaker();

           puzz.generate();

           txtGrid1_1.Text = puzz.puzzle[0, 0].ToString();
           txtGrid1_2.Text = puzz.puzzle[0, 1].ToString();
           txtGrid1_3.Text = puzz.puzzle[0, 2].ToString();
           txtGrid1_4.Text = puzz.puzzle[0, 3].ToString();
           txtGrid1_5.Text = puzz.puzzle[0, 4].ToString();
           txtGrid1_6.Text = puzz.puzzle[0, 5].ToString();
           txtGrid1_7.Text = puzz.puzzle[0, 6].ToString();
           txtGrid1_8.Text = puzz.puzzle[0, 7].ToString();
           txtGrid1_9.Text = puzz.puzzle[0, 8].ToString();
           txtGrid2_1.Text = puzz.puzzle[1, 0].ToString();
           txtGrid2_2.Text = puzz.puzzle[1, 1].ToString();
           txtGrid2_3.Text = puzz.puzzle[1, 2].ToString();
           txtGrid2_4.Text = puzz.puzzle[1, 3].ToString();
           txtGrid2_5.Text = puzz.puzzle[1, 4].ToString();
           txtGrid2_6.Text = puzz.puzzle[1, 5].ToString();
           txtGrid2_7.Text = puzz.puzzle[1, 6].ToString();
           txtGrid2_8.Text = puzz.puzzle[1, 7].ToString();
           txtGrid2_9.Text = puzz.puzzle[1, 8].ToString();
           txtGrid3_1.Text = puzz.puzzle[2, 0].ToString();
           txtGrid3_2.Text = puzz.puzzle[2, 1].ToString();
           txtGrid3_3.Text = puzz.puzzle[2, 2].ToString();
           txtGrid3_4.Text = puzz.puzzle[2, 3].ToString();
           txtGrid3_5.Text = puzz.puzzle[2, 4].ToString();
           txtGrid3_6.Text = puzz.puzzle[2, 5].ToString();
           txtGrid3_7.Text = puzz.puzzle[2, 6].ToString();
           txtGrid3_8.Text = puzz.puzzle[2, 7].ToString();
           txtGrid3_9.Text = puzz.puzzle[2, 8].ToString();
           txtGrid4_1.Text = puzz.puzzle[3, 0].ToString();
           txtGrid4_2.Text = puzz.puzzle[3, 1].ToString();
           txtGrid4_3.Text = puzz.puzzle[3, 2].ToString();
           txtGrid4_4.Text = puzz.puzzle[3, 3].ToString();
           txtGrid4_5.Text = puzz.puzzle[3, 4].ToString();
           txtGrid4_6.Text = puzz.puzzle[3, 5].ToString();
           txtGrid4_7.Text = puzz.puzzle[3, 6].ToString();
           txtGrid4_8.Text = puzz.puzzle[3, 7].ToString();
           txtGrid4_9.Text = puzz.puzzle[3, 8].ToString();
           txtGrid5_1.Text = puzz.puzzle[4, 0].ToString();
           txtGrid5_2.Text = puzz.puzzle[4, 1].ToString();
           txtGrid5_3.Text = puzz.puzzle[4, 2].ToString();
           txtGrid5_4.Text = puzz.puzzle[4, 3].ToString();
           txtGrid5_5.Text = puzz.puzzle[4, 4].ToString();
           txtGrid5_6.Text = puzz.puzzle[4, 5].ToString();
           txtGrid5_7.Text = puzz.puzzle[4, 6].ToString();
           txtGrid5_8.Text = puzz.puzzle[4, 7].ToString();
           txtGrid5_9.Text = puzz.puzzle[4, 8].ToString();
           txtGrid6_1.Text = puzz.puzzle[5, 0].ToString();
           txtGrid6_2.Text = puzz.puzzle[5, 1].ToString();
           txtGrid6_3.Text = puzz.puzzle[5, 2].ToString();
           txtGrid6_4.Text = puzz.puzzle[5, 3].ToString();
           txtGrid6_5.Text = puzz.puzzle[5, 4].ToString();
           txtGrid6_6.Text = puzz.puzzle[5, 5].ToString();
           txtGrid6_7.Text = puzz.puzzle[5, 6].ToString();
           txtGrid6_8.Text = puzz.puzzle[5, 7].ToString();
           txtGrid6_9.Text = puzz.puzzle[5, 8].ToString();
           txtGrid7_1.Text = puzz.puzzle[6, 0].ToString();
           txtGrid7_2.Text = puzz.puzzle[6, 1].ToString();
           txtGrid7_3.Text = puzz.puzzle[6, 2].ToString();
           txtGrid7_4.Text = puzz.puzzle[6, 3].ToString();
           txtGrid7_5.Text = puzz.puzzle[6, 4].ToString();
           txtGrid7_6.Text = puzz.puzzle[6, 5].ToString();
           txtGrid7_7.Text = puzz.puzzle[6, 6].ToString();
           txtGrid7_8.Text = puzz.puzzle[6, 7].ToString();
           txtGrid7_9.Text = puzz.puzzle[6, 8].ToString();
           txtGrid8_1.Text = puzz.puzzle[7, 0].ToString();
           txtGrid8_2.Text = puzz.puzzle[7, 1].ToString();
           txtGrid8_3.Text = puzz.puzzle[7, 2].ToString();
           txtGrid8_4.Text = puzz.puzzle[7, 3].ToString();
           txtGrid8_5.Text = puzz.puzzle[7, 4].ToString();
           txtGrid8_6.Text = puzz.puzzle[7, 5].ToString();
           txtGrid8_7.Text = puzz.puzzle[7, 6].ToString();
           txtGrid8_8.Text = puzz.puzzle[7, 7].ToString();
           txtGrid8_9.Text = puzz.puzzle[7, 8].ToString();
           txtGrid9_1.Text = puzz.puzzle[8, 0].ToString();
           txtGrid9_2.Text = puzz.puzzle[8, 1].ToString();
           txtGrid9_3.Text = puzz.puzzle[8, 2].ToString();
           txtGrid9_4.Text = puzz.puzzle[8, 3].ToString();
           txtGrid9_5.Text = puzz.puzzle[8, 4].ToString();
           txtGrid9_6.Text = puzz.puzzle[8, 5].ToString();
           txtGrid9_7.Text = puzz.puzzle[8, 6].ToString();
           txtGrid9_8.Text = puzz.puzzle[8, 7].ToString();
           txtGrid9_9.Text = puzz.puzzle[8, 8].ToString();
       }