哪个高高手帮忙注释下!!迷宫问题的C语言程序!

来源:百度知道 编辑:UC知道 时间:2024/05/13 06:12:34
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <graphics.h>
#define LEFT 120
#define TOP 40
#define RIGHT 520
#define BOTTOM 440
#define SMALL 20
int b[20][20]; /*用来保存地图信息*/
b[20][20]={{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,1},
{1,0,1,0,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,1},
{1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,1,0,1},
{1,0,0,0,0,1,0,0,1,0,0,0,1,0,1,1,0,1,0,1},
{1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,0,1,0,1},
{1,1,0,0,1,1,0,0,1,0,0,1,0,1,1,0,1,0,0,1},
{1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,1},
{1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1},
{1,0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,1,1},
{1,0,0,0,1,1,0,1,0,0,0,1,1,0,1,0,1,0,0,1},
{1,0,1,1,1,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1},
{1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1},
{1,1,0,1,1,0,1,0,0,1,0,1,1,1,0,1,1,0,

#include"time.h"
#include "stdio.h"
#include "graphics.h"
#include "conio.h"
#define null 0

int a[11][15]={ {1,0,1,1,1,0,0,1,1,1,0,0,0,0,0}, /定义迷宫,这是我们课程设计,所以就用老师给的了/
{0,1,1,1,0,0,1,0,0,0,0,1,1,0,0}, /0代表墙,1代表可以通行/
{1,0,0,1,1,1,1,0,0,0,0,0,1,0,0},
{0,0,1,0,0,0,0,1,0,0,0,1,0,1,1},
{0,0,1,0,1,1,0,1,0,0,0,0,0,0,0},
{1,1,0,0,1,0,0,0,1,0,1,1,0,0,0},
{1,0,0,0,0,1,1,0,0,0,0,0,0,0,0},
{1,1,0,0,1,0,0,1,0,0,0,0,0,1,0},
{0,0,1,1,1,0,0,1,0,0,1,1,1,1,1},
{1,1,0,0,0,0,0,1,1,1,0,0,0,0,1},
{1,0,1,1,0,0,0,0,0,1,0,0,0,0,1}
};
struct moving /定义走动方向/
{int x;
int y;
}move[9]={{0,0},{1,1},{0,1},{1,0},{-1,1},{1,-1},{-1,0},{0,-1},{-1,-1}};
typedef struct Position *P