commit a91569dfec0c9b44d78c0b1c72bbebc8807ea94f Author: Your Name Date: Thu Jan 10 14:50:32 2019 +0800 first commit diff --git a/迷宫游戏.cpp b/迷宫游戏.cpp new file mode 100644 index 0000000..348e691 --- /dev/null +++ b/迷宫游戏.cpp @@ -0,0 +1,237 @@ +#include +#include +#include +#include +#include +#define M 3 +#define N 18 +#define Max 10000 +void draw(int map[20][20]); +int mg[20][20]={0} ; //㷨Ҫõĵͼ +void gotoxy(int x, int y) { + COORD pos = {x,y}; + HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);// ȡ׼豸 + SetConsoleCursorPosition(hOut, pos);//ֱָĸ壬λ +} +struct +{ +int i,j; //λ +int pre; //·һڶе± +}Qu[Max]; +void print(int n); +int mgpath(int xi,int yi,int xe,int ye) //㷨 +{ +int i,j,di,pp=250; +int front=-1,rear=-1; +rear++; +Qu[rear].i=xi; +Qu[rear].j=yi; +Qu[rear].pre=-1; +mg[xi][yi]=-1; +while(front