C语言迷宫求解 求解函数执行还有有关问题 大家帮忙看上啊拜托了,很急
C语言迷宫求解 求解函数执行还有问题 大家帮忙看下啊,拜托了,很急~
//C语言迷宫求解 求解函数执行还有问题 大家帮忙看下啊,拜托了,很急~
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<time.h>
#define TRUE 1
#define FALSE 0
#define OVERFLOW -1
#define ERROR -2
#define width 6 //迷宫地图宽度
#define height 6 //迷宫地图高度
#define STACK_INIT_SIZE 50 //栈存储空间初始分配量
#define STACKINCREMENT 10 //栈存储空间分配增量
typedef struct //游戏中的位置坐标
{ //二维数组下标
int x;
int y;
}Position;
typedef struct
{
Position start; //起始位置
Position end; //结束位置
int curstep;
}MapCfg;
MapCfg map;
typedef struct
{
int ord; //通道块在路径上的序号
Position curpos; //通道块在迷宫中的位置坐标
int di; //从此通道块走向下一通道块的"方向"
int footprint; //是否可以通过的标记, -1:已访问 -2:不可通过
}SElemType;
SElemType e;
typedef struct{
SElemType* base; //栈底指针
SElemType* top; //栈顶指针
int stacksize; //栈的大小
}SqStack;
SqStack S; //S 探索迷宫 存放路径
int count = 0; //用于计数,判断次数
int **Maze()
{
int i=0,j=0;
int **maze; //定义二维指针存取迷宫
//C语言迷宫求解 求解函数执行还有问题 大家帮忙看下啊,拜托了,很急~
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<time.h>
#define TRUE 1
#define FALSE 0
#define OVERFLOW -1
#define ERROR -2
#define width 6 //迷宫地图宽度
#define height 6 //迷宫地图高度
#define STACK_INIT_SIZE 50 //栈存储空间初始分配量
#define STACKINCREMENT 10 //栈存储空间分配增量
typedef struct //游戏中的位置坐标
{ //二维数组下标
int x;
int y;
}Position;
typedef struct
{
Position start; //起始位置
Position end; //结束位置
int curstep;
}MapCfg;
MapCfg map;
typedef struct
{
int ord; //通道块在路径上的序号
Position curpos; //通道块在迷宫中的位置坐标
int di; //从此通道块走向下一通道块的"方向"
int footprint; //是否可以通过的标记, -1:已访问 -2:不可通过
}SElemType;
SElemType e;
typedef struct{
SElemType* base; //栈底指针
SElemType* top; //栈顶指针
int stacksize; //栈的大小
}SqStack;
SqStack S; //S 探索迷宫 存放路径
int count = 0; //用于计数,判断次数
int **Maze()
{
int i=0,j=0;
int **maze; //定义二维指针存取迷宫