Beispiel #1
0
 public Form1()
 {
     InitializeComponent();
     mazeSolver         = new MazeSolver();
     mazeBox            = new Panel[25];
     mazeBox[0]         = maze0;
     mazeBox[1]         = maze1;
     mazeBox[2]         = maze2;
     mazeBox[3]         = maze3;
     mazeBox[4]         = maze4;
     mazeBox[5]         = maze5;
     mazeBox[6]         = maze6;
     mazeBox[7]         = maze7;
     mazeBox[8]         = maze8;
     mazeBox[9]         = maze9;
     mazeBox[10]        = maze10;
     mazeBox[11]        = maze11;
     mazeBox[12]        = maze12;
     mazeBox[13]        = maze13;
     mazeBox[14]        = maze14;
     mazeBox[15]        = maze15;
     mazeBox[16]        = maze16;
     mazeBox[17]        = maze17;
     mazeBox[18]        = maze18;
     mazeBox[19]        = maze19;
     mazeBox[20]        = maze20;
     mazeBox[21]        = maze21;
     mazeBox[22]        = maze22;
     mazeBox[23]        = maze23;
     mazeBox[24]        = maze24;
     mazeBox[0].Paint  += paintCircle;
     mazeBox[0].Enabled = false;
 }
Beispiel #2
0
 private void buttonReset_Click(object sender, EventArgs e)
 {
     mazeBox[mazeSolver.Start].Paint -= paintCircle;
     mazeBox[0].Paint += paintCircle;
     Refresh();
     //mazeBox[mazeSolver.Start].Enabled = true;
     mazeBox[0].Enabled = false;;
     for (int i = 0; i < 25; i++)
     {
         mazeBox[i].BackColor = SystemColors.Control;
         mazeBox[i].Enabled   = true;
     }
     mazeBox[0].Enabled = false;
     pathLabel.Text     = "(0,0)";
     mazeSolver         = new MazeSolver();
     radioWall.Checked  = true;
 }