/* Configure /*--------------------------------------------------------------------------------------------
// File name: MazeMouse. cpp
// Skill: Find all paths and shortest paths out of the maze.
// Prepared by: sun exposure week
Optional --------------------------------------------------------------------------------------------*/
/* Configure /*--------------------------------------------------------------------------------------------
// Modify record: number date modifier remarks
// 0 2003.04.14 sun exposure weekly Creation
Optional --------------------------------------------------------------------------------------------*/
# Include "stdafx. h"
# Include "iostream. h"
# Include "string. h"
# Include "stdio. h"
Double dMeans = 0, dw.len = 10000; // dMeans indicates the method for going out of the maze. dw.len indicates the minimum number of steps currently going out of the maze.
Char Maze [10] [52] = {
{"###################################### #############"},
{"% #################"},
{"##################################"},
{"######################"},
{"##########################"},
{"########################"},
{"#################################"},
{"######################"},
{"########################@"},
{"###################################### #############"},
}; // Maze
Int MazeFlag [10] [51]; // The Sign of the Maze: 0 indicates that it has not passed, I (I = 1, 2, 3, 4) indicates that it has passed, and I indicates the direction.
Int MazeMin [10] [51]; // The Sign of the maze with the smallest path
Void Walk (int nx, int ny); // a function that follows the maze. nx indicates a column and ny indicates a row.
Void PrintOut (); // print the path and the function of the maze, and compare the walking method that obtains the shorter path.
Int Judge (int nx, int ny, int I); // determines whether the row in column nx can go in the direction of column I. If yes, 1 is returned. Otherwise, 0 is returned.
// I = 1 indicates right, 2 indicates down, 3 indicates left, 4 indicates up
<