private void btnReset_Click(object sender, EventArgs e) { PuzzleData.resetPuzzle(); // SetBegin(); UpdatePuzzle(); DFS.resetAll(); ProgDFS.resetAll(); AStar.resetAll(); lblStatus.Text = "Puzzle Reset!"; }
//The below three methods are all what the event handlers for when the box9 animation finishes. They just //iterate call the same functions similar to a recursive method but the function does exit each time. //If the algorithm complete flag has been set it updates the status message and resets all the variables //that the algorithm uses by calling it's own resetAll() method. void DFS_Completed() { if (!DFS.solvePuzzle()) { UpdatePuzzle(DFS.xTempPuzzle, DFS.yTempPuzzle); } else { lblStatus.Text = "Puzzle Solved using Depth-First Search. No of Moves made: "; lblStatus.Text += DFS.getNumberOfMovesMade().ToString(); DFS.resetAll(); } }