diff --git a/迷宫游戏.cpp b/迷宫游戏.cpp index 348e691..ba6d047 100644 --- a/迷宫游戏.cpp +++ b/迷宫游戏.cpp @@ -6,13 +6,7 @@ #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; //λ @@ -234,4 +228,28 @@ int main(void) } return 0; } - +void draw(int map[20][20]) +{ + int i,j; + system("cls") ; // + printf("Ϸʼ : WASDƶ R¿ʼ Tʾ(WSAD)\n"); + for(i=0;i<20;i++,printf("\n")) //мDzҪ˻ + { + for(j=0;j<20;j++) + { + + if(map[i][j]==0) printf(" "); + if(map[i][j]==1) printf(""); + if(map[i][j]==2) printf(""); + if(i==18&&j==3) printf(""); + + if(map[i][j]==4) printf(" "); + if(map[i][j]==5) printf(""); + if(i==18&&j==4) printf(" "); + printf("\33[?25l") ; //ʹ겻ٳ + + } + + } + +}