You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<math.h>
|
|
|
|
|
#include<windows.h>
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
#define M 100
|
|
|
|
|
#define N 100
|
|
|
|
|
#define Road 1
|
|
|
|
|
#define Wall 0
|
|
|
|
|
#define Des 3
|
|
|
|
|
#define Player 4
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
COORD coord; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>*/
|
|
|
|
|
short map[N][M];/*<2A><>ͼ */
|
|
|
|
|
int x,y;/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int m=21,n=21;/*ʵ<>ʵ<EFBFBD>ͼ<EFBFBD><CDBC>С */
|
|
|
|
|
int flag; /*
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
|
|
|
|
|
0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>
|
|
|
|
|
1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ
|
|
|
|
|
3<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>Ϸ
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
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();
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
HideCursor();
|
|
|
|
|
system("title <20>Թ<EFBFBD><D4B9><EFBFBD>Ϸ");
|
|
|
|
|
flag=0;
|
|
|
|
|
while(1){
|
|
|
|
|
if(flag==0) mune();
|
|
|
|
|
if(flag==1){
|
|
|
|
|
coord.X = 2;
|
|
|
|
|
coord.Y = 1;
|
|
|
|
|
xy(); //<2F><><EFBFBD><EFBFBD>Ļָ<C4BB><D6B8>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼλ<CABC><CEBB>
|
|
|
|
|
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;
|
|
|
|
|
}
|