正在加载图片...
C:C: Windows\system32\end. exe Include<stdio. h> 初始迷 #include<malloc. h ■■■ #include<stdlib. h> #include<time. h> #include<math. h> ■■■■■■■■■ //函数状态码定义 位置坐标从<00到<9.9):2,4 #define TRUE 从<,B)到<9,9):5,2 define false ■■■■■■■ #define oK #define error #define INFEASIBle -l Define null ■■■■■■■■■ 体路径为 //墙或通路及前进方向符号定义 step:1 to <2,4> Define WALl 0 /代表当前格子是墙 tep: 2 to (2.5) step:3 to (3,5> Define path 1 /代表是通路且未走过 tep:4 to <3, 4> #define right ∥代表是通路且从其向右走Ftep:5to33 step:6to(4,3) #define down /代表是通路且从其向下走tep:?to<53 #define left -3 /代表是通路且从其向左走 step:8 to (5,2) 输入任意数字键结 #define UP-4 /代表是通路且从其向上走 /代表是通路且从其后退一步 # define destinati0N-6/代表当前格子是通路且是目标位置 ypedef int MazeType[l0][10]://最外凿初始化成墙,实际含*8个格子 typedef int Status typedef int ElemType;//迷宫数组中的元素类型 一栈的定义和实现,采用顺序存储结构一 #define sTACK INIT size 100 Define sTacKIncrement 10 ypedef struct Int y: } Pos Type;//迷宫中坐标的位置 typedef struct( int ord PosType seat#include<stdio.h> #include<malloc.h> #include<stdlib.h> #include<time.h> #include<math.h> //函数状态码定义 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define NULL 0 //墙或通路及前进方向符号定义 #define WALL 0 //代表当前格子是墙 #define PATH 1 //代表是通路且未走过 #define RIGHT -1 //代表是通路且从其向右走 #define DOWN -2 //代表是通路且从其向下走 #define LEFT -3 //代表是通路且从其向左走 #define UP -4 //代表是通路且从其向上走 #define BACK -5 //代表是通路且从其后退一步 #define DESTINATION -6 //代表当前格子是通路且是目标位置 typedef int MazeType[10][10]; //最外凿初始化成墙,实际含*8个格子 typedef int Status; typedef int ElemType; //迷宫数组中的元素类型 //----------栈的定义和实现,采用顺序存储结构------------// #define STACK_INIT_SIZE 100 #define STACKINCREMENT 10 typedef struct{ int x; int y; }PosType;//迷宫中坐标的位置 typedef struct{ int ord; PosType seat;
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有