private void clearMaze() { processTotal = SIDE_LENGTH * SIDE_LENGTH; processNow = 0; width = SIDE_LENGTH; //迷宫的宽度-列数 height = SIDE_LENGTH; //迷宫的高度-行数 chessLength = SIDE_LENGTH > 10 ? 400 / SIDE_LENGTH : 40; initSource(); //删除当前图层 mazeBox.Controls.Clear(); //设置用户位置为0 pointX = pointY = 0; //初始化numMap数组 if (numMap != null) { numMap.Initialize(); } //初始化Path数组 if (path != null) { path.Initialize(); } //清空栈记录 stack.ClearStack(); }