commit 3c7adf2790378619e98da24c126e8cd8e1239c66 Author: AceTeemo <609544959@qq.com> Date: Wed Jan 9 19:36:50 2019 +0800 1 diff --git a/v1.c b/v1.c new file mode 100644 index 0000000..0fd035a --- /dev/null +++ b/v1.c @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#include +//变量声明 +#define M 100 +#define N 100 +#define Road 1 +#define Wall 0 +#define Des 3 +#define Player 4 +//定义光标位置 +COORD coord; /*光标地址变量*/ +short map[N][M];/*地图 */ +int x,y;/*人物坐标 */ +int m=21,n=21;/*实际地图大小 */ +int flag; /* + 控制界面切换 + 0:主菜单 + 1:游戏界面 + 2:结束游戏 + 3:退出游戏 + */ + +//函数声明 +void mune(); +void print(); +void Print(char); +void up(); +void down(); +void right(); +void left(); +void gotc(); +void Map_1(); +void xy(); +void HideCursor(); +void chu(); +char des(int,int); +void dig(char,int,int); +void make(int,int); +void CreateMaze(); +void win(); +void end(); +//主函数 +int main() +{ + HideCursor(); + system("title 迷宫游戏"); + flag=0; + while(1){ + if(flag==0) mune(); + if(flag==1){ + coord.X = 2; + coord.Y = 1; + xy(); //将屏幕指针位置移向初始位置 + if(n==21) system("mode con cols=42 lines=22"); + else if(n==31) system("mode con cols=62 lines=32"); + else if(n==41) system("mode con cols=82 lines=42"); + print(n,m); + gotc(); + } + if(flag==2){ + win(); + flag=0; + } + if(flag==3){ + end(); + break; + } + } + return 0; +}