Maze Problem Find a path from the maze entry to maze exit.
Question
To represent a maze, we set the following array mg in which each element represents a block. 0 indicates the block is a path, and 1 indicates the block is a wall. int mg[M+1][N+1]={ /*M=10,N=10*/{1,1,1,1,1,1,1,1,1,1}, {1,0,0,1,0,0,0,1,0,1},{1,0,0,1,0,0,0,1,0,1}, {1,0,0,0,0,1,1,0,0,1}, {1,0,1,1,1,0,0,0,0,1}, {1,0,0,0,1,0,0,0,0,1}, {1,0,1,0,0,0,1,0,0,1}, {1,0,1,1,1,0,1,1,0,1}, {1,1,0,0,0,0,0,0,0,1}, {1,1,1,1,1,1,1,1,1,1}};
Attachment
Leave an answer
You must login or register to add a new answer .