0
rat maze
Pls help me in rat 10 length 10 width (c or java) https://www.sololearn.com/discuss/3176197/?ref=app 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}};
3 Answers
+ 3
Please provide a complete and clear task description. Show your code attempt.
0
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}};
0
  typedef struct stack_type{ 
             block_type block[Max];   /*blocks are stack elements*/
             int top;           /*stack top*/
     } stack_type;                   /*stack definition*/
     typedef struct block_type{
             int i, j;                                /* row & column number */ 
             int di;                                 /*next exploring direction*/
     }block_type;                   /*block definition*/





