C++走迷宫(免费复制)6.0

35 篇文章 7 订阅
9 篇文章 1 订阅
本文介绍了一个走迷宫的游戏,玩家在经历飞机失事后,意外进入了一个未知的迷宫。游戏包含多个关卡,每个关卡有不同的地图和挑战,如障碍、炸药、钥匙和刺刀等。玩家需要通过WASD键控制角色移动,避开陷阱,找到出口,同时还要注意生命值。游戏中还有皮肤、颜色和新手教程等特色功能,增加了游戏的趣味性和可玩性。
摘要由CSDN通过智能技术生成
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
long long s=1,shengming=20,bushu=0,leiren,lx1,ly1,lx,ly,fhq=1;
const long long n=59,jg=25,dengji=0;
bool yaoshi=0,leiren2;
string p=" M!|=.123456789%&_~?Win";
long long r=1;
char f='y';
void color(int a)//打印颜色
{
/*亮白*/    if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
/*蓝色*/    if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
/*绿色*/    if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
/*紫色*/    if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
/*红色*/    if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
/*黄色*/    if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
/*深蓝色*/    if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
/*土黄色or金黄色*/    if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
/*灰色接近白*/    if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
/*void lrmove(int yyy) {
    if (lx>x&&lx-1!='#'&&lx-1!='^'&&lx-1!='V'&&lx-1!='<'&&lx-1!='>'&&lx-1!='*'&&lx-1!='0'&&lx-1!='+'&&lx-1!='-'&&lx-1!='Z'&&lx-1!='D') {
        lx-=1;
    }
    if (lx<x&&lx+1!='#'&&lx+1!='^'&&lx+1!='V'&&lx+1!='<'&&lx+1!='>'&&lx+1!='*'&&lx+1!='0'&&lx+1!='+'&&lx+1!='-'&&lx+1!='Z'&&lx+1!='D') {
        lx+=1;
    }
    if (ly<y&&ly+1!='#'&&ly+1!='^'&&ly+1!='V'&&ly+1!='<'&&ly+1!='>'&&ly+1!='*'&&ly+1!='0'&&ly+1!='+'&&ly+1!='-'&&ly+1!='Z'&&ly+1!='D') {
        lx+=1;
    }
    if (ly<y&&ly-1!='#'&&ly-1!='^'&&ly-1!='V'&&ly+1!='<'&&ly-1!='>'&&ly-1!='*'&&ly-1!='0'&&ly-1!='+'&&ly-1!='-'&&ly-1!='Z'&&ly-1!='D') {
        if()
        lx-=1;
    }
}*/
long long numberaio(string n){
    for (int i = 0; i < 100000; i++) {
        if(n[i]=='\0')
        {
            return i;
        }
    }
}
void coutAIO(string b,int truefalse0 = 1,bool truefalse1 = 0){
    int i=0,s=0;
    long long a=numberaio(b);
    while(a!=0){
        s=rand()%9;
        if(a!=0&&s==0)
        {
            color(0);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==1)
        {
            color(1);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==2)
        {
            color(2);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==3)
        {
            color(3);
            cout << b[i];
            a--;
            i++;
            if(truefalse0!=false){
                Sleep(20);
            }
        }
        if(a!=0&&s==4)
        {
            color(4);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==5)
        {
            color(5);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==6)
        {
            color(6);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==7)
        {
            color(7);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==8)
        {
            color(8);
            cout << b[i];
            a--;
            i++;
        }
        if(truefalse0 ==1){
            Sleep(10);
        }
        if(truefalse0 ==2){
            Sleep(20);
        }
        if(truefalse0 ==3){
            Sleep(40);
        }
        if(truefalse0 ==4){
            Sleep(100);
        }
        if(truefalse0 ==5){
            Sleep(300);
        }
        if(truefalse0 ==6){
            Sleep(1000);
        }
    }
    if(truefalse1!=false){
        getch();
        system("cls");
    }
    cout << endl;
}
void ksjm()
{
	system("color f0");
	cout<<"按任意键开始游戏";
	getch();
	system("cls"); 
	for(long long i=1;i<=3;i++)
	{
		system("color 07");
		system("color 10");
		system("color 20");
		system("color 30");
		system("color 40");
		system("color 50");
		system("color 60");
		system("color 70");
		system("color 80");
		system("color 90");
		system("color a0");
		system("color b0");
		system("color c0");
		system("color d0");
		system("color e0");
		system("color f0");
	}
	cout<<"\n\n\n\n\n\n\n\n\n\n\n                                                      ";
	coutAIO("走迷宫",2);
	cout<<"\n";
	cout<<"                                                   ";
	coutAIO("出品:饼干,修改:努力的AIO",5);
	Sleep(1500);
} 
int start()
{
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("一天,你坐着飞机,正打算去美国...",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("一边看着电影,一边喝着饮料",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("突然,飞机开始颠簸,你手中饮料摔到了地上,洒了一地",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□■■■■■■□□■■□□■■■■■■□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□■■■■■■□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	coutAIO("一秒钟后,飞机开始往下坠落",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□■■■■■■□□■■□□■■■■■■□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□■■■■■■□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	coutAIO("行李架上的行李掉了下来,砸中了你,你眼前一黑,昏了过去...",3);
	Sleep(1000);
	system("cls");
	Sleep(3000);
	coutAIO("醒来后,你发现你在一个无人区,误入了迷宫。");
	getch();
	return 0;
}
void start(int n)
{
	system("cls");
    cout<<"加载中请稍等";
    Sleep(1000);
    system("cls");
	for (int i=1;i<=n; i++)
	{
		cout<<"加载中."<<endl;
		cout<<"▏";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▎";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▍";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▋";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▊";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▏";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▎";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▍";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▌";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▋";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▊";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▉";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▉▏";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▉▎";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▉▍";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▉▌";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▉▋";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▉▊";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▉▉▏";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▉▉▎";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▉▉▍";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▉▉▌";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▉▉▋";
		Sleep(20);
		system("cls");
		cout<<"加载中."<<endl;
		cout<<"▉▉▉▋";
		Sleep(20);
		system("cls");
		cout<<"加载中.."<<endl;
		cout<<"▉▉▉▊";
		Sleep(20);
		system("cls");
		cout<<"加载中..."<<endl;
		cout<<"▉▉▉▉";
		Sleep(20);
		system("cls");
	}
	coutAIO("加载完成!请等待十秒",4);
    Sleep(2000);
    system("cls");
    Sleep(8000);
    ksjm();
    start();
}
void print(string a[n])//输出迷宫
{
    system("cls");
    for(long long i=0;i<n;i++)
    cout<<a[i]<<endl;
}
void tc()//关闭界面
{
	system("cls");
	cout<<"\n\n\n\n\n                    欢迎下次再玩,拜拜!!!\n";
	cout<<"                    原作:饼干,改编:VIC\n";
	cout<<"                  (按空格结束)";
	long long ok='\0';
	while(ok=getch(),ok!=' ');
	system("cls");
	return ;
}
void hf()//皮肤
{
	char t='\0';
	while(t!=' ')
	{
		system("cls");
		cout<<"\n\n\n\n	    			   	A D键换皮肤    空格确定\n\n";
		cout<<"\n\n\n\n						  "<<p[r]<<"\n";
		t=getch();
		if(t=='a')r--;
		else
		if(t=='d')r++;
		if(r<1)r=jg;
		if(r>jg)r=1;
	}
	system("cls");
	return ;
}
void sm()//说明
{
	system("cls");
	cout<<"\n\n		说明:\n\n\n";
	cout<<"					按空格开始游戏后\n";
	cout<<"					  W\n";
	cout<<"					A S D\n";
	cout<<"					移动\n";
	cout<<"					M是你\n";
	cout<<"			   		按R键返回起点\n";
	cout<<"			   		按P键返回主界面\n";
	cout<<"			   		按Q键设立传送点\n";
	cout<<"			   		按E键返回传送点\n";
	cout<<"			   		Z处为终点\n\n\n";
	cout<<"			   		-号处为左右穿刺,可到另一头,但减血5滴\n\n\n";
	cout<<"			   		*号处为炸药\n\n\n";
	cout<<"			   		#号处为障碍物\n\n\n";
	cout<<"			   		?号处为可清理障碍物\n\n\n";
	cout<<"			   		V处为下刺\n\n\n";
	cout<<"			   		<处为左刺\n\n\n";
	cout<<"			   		>处为右刺\n\n\n";
	cout<<"			   		^处为上刺\n\n\n";
	cout<<"			   		@处为钥匙\n\n\n";
	cout<<"			   		+号处为加血\n\n\n";
	cout<<"			   		0处为死地(每个普通关只有一个,BOSS关有五个,超级BOSS关有10个以上)\n\n\n";
	cout<<"			   		死亡:当生命为负数或零时,会死亡。可买复活券满血复活\n\n\n";
	cout<<"			按空格继续···";
	long long ok='\0';
	while(ok=getch(),ok!=' ');
	system("cls");
	return ;
}
void sd()//商店
{
	system("cls");
	cout<<"\n\n		欢迎来到【X2G超市】!你想买什么?\n\n\n";
	cout<<"			   		1.加血羹(加满血,花20金币)\n\n\n";
	cout<<"			   		2.复活券\n\n\n";
	int what;
	cin>>what;
	if(what==1){
	    
	}
	system("cls");
	return ;
}
void siwang(){
    if ( MessageBox(NULL, "你死了!!!是否重新游戏?","死亡", MB_ICONQUESTION|MB_YESNO) != IDYES )
	{
	    coutAIO("游戏结束!",3,1);
	    exit(0);
	}
	s=1;
}
void full_screen()
{   
    HWND hwnd = GetForegroundWindow();
    int cx = GetSystemMetrics(SM_CXSCREEN);            /* 屏幕宽度 像素 */
    int cy = GetSystemMetrics(SM_CYSCREEN);            /* 屏幕高度 像素 */

    LONG l_WinStyle = GetWindowLong(hwnd,GWL_STYLE);   /* 获取窗口信息 */
    /* 设置窗口信息 最大化 取消标题栏及边框 */
    SetWindowLong(hwnd,GWL_STYLE,( WS_MAXIMIZE| WS_POPUP) & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_BORDER);// 

    SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, 0);
}
void hys()//背景
{
	system("cls");
	cout<<"\n\n\n\n\n\n\n\n\n按1【日间色】\n";
	cout<<"按2【夜间色】\n";
	cout<<"按3【黑客】\n";
	cout<<"按4【科幻】\n";
	cout<<"按5【紫水晶】\n";
	char s;
	s=getch();
	while(s!='1'&&s!='2'&&s!='3'&&s!='4'&&s!='5')s=getch();
	switch(s-'0')
	{
		case 1:
			system("color f0");
			break;
		case 2:
			system("color 0f");
			break;
		case 3:
			system("color 0a");
			break;
		case 4:
			system("color 09");
			break;
		case 5:
			system("color 01");
			break;
	}
	system("cls");
	return ;
}
void xsjc()//新手教程 
{
	char xxx[100][100]={
		"#############",
		"#M          #",
		"#           #",
		"#    O      #",
		"#           #",
		"#%          #",
		"#           #",
		"#############"
	};
	for(int i=0;i<=10;i++)
		puts(xxx[i]);
	coutAIO("新手引导:试着移动!",3);
	coutAIO("(O是炸弹,%是猎人)",3);
	cout<<endl;
	coutAIO("找到移动的规律,让炸弹炸掉猎人!(注意自己不要碰到炸弹)",3); 
	char chxx;
	int hang_lr=5,lie_lr=1,hang_player=1,lie_player=1;
	while(1){
		chxx=_getch();
		if(chxx=='d'){
			if(xxx[hang_player][lie_player+1]!='#'&&xxx[hang_lr][lie_lr+1]!='#'){
				xxx[hang_player][lie_player]=' ';
				lie_player++;
				xxx[hang_player][lie_player]='M';
				xxx[hang_lr][lie_lr]=' ';
				lie_lr++;
				xxx[hang_lr][lie_lr]='%';
			}
			if(xxx[hang_player][lie_player+1]==' '&&xxx[hang_lr][lie_lr+1]=='#'){
				xxx[hang_player][lie_player]=' ';
				lie_player++;
				xxx[hang_player][lie_player]='M';
			}
			if(xxx[hang_player][lie_player+1]=='#'&&xxx[hang_lr][lie_lr+1]==' '){
				xxx[hang_lr][lie_lr]=' ';
				lie_lr++;
				xxx[hang_lr][lie_lr]='%';
			}
		}
		if(chxx=='a'){
			if(xxx[hang_player][lie_player-1]!='#'&&xxx[hang_lr][lie_lr-1]!='#'){
				xxx[hang_player][lie_player]=' ';
				lie_player--;
				xxx[hang_player][lie_player]='M';
				xxx[hang_lr][lie_lr]=' ';
				lie_lr--;
				xxx[hang_lr][lie_lr]='%';
			}
			if(xxx[hang_player][lie_player-1]==' '&&xxx[hang_lr][lie_lr-1]=='#'){
				xxx[hang_player][lie_player]=' ';
				lie_player--;
				xxx[hang_player][lie_player]='M';
			}
			if(xxx[hang_player][lie_player-1]=='#'&&xxx[hang_lr][lie_lr-1]==' '){
				xxx[hang_lr][lie_lr]=' ';
				lie_lr--;
				xxx[hang_lr][lie_lr]='%';
			}
		}		
		if(chxx=='w'){
			if(xxx[hang_player-1][lie_player]!='#'&&xxx[hang_lr-1][lie_lr]!='#'){
				xxx[hang_player][lie_player]=' ';
				hang_player--;
				xxx[hang_player][lie_player]='M';
				xxx[hang_lr][lie_lr]=' ';
				hang_lr--;
				xxx[hang_lr][lie_lr]='%';
			}
			if(xxx[hang_player-1][lie_player]==' '&&xxx[hang_lr-1][lie_lr]=='#'){
				xxx[hang_player][lie_player]=' ';
				hang_player--;
				xxx[hang_player][lie_player]='M';
			}
			if(xxx[hang_player-1][lie_player]=='#'&&xxx[hang_lr-1][lie_lr]==' '){
				xxx[hang_lr][lie_lr]=' ';
				hang_lr--;
				xxx[hang_lr][lie_lr]='%';
			}
		}
		if(chxx=='s'){
			if(xxx[hang_player+1][lie_player]!='#'&&xxx[hang_lr+1][lie_lr]!='#'){
				xxx[hang_player][lie_player]=' ';
				hang_player++;
				xxx[hang_player][lie_player]='M';
				xxx[hang_lr][lie_lr]=' ';
				hang_lr++;
				xxx[hang_lr][lie_lr]='%';
			}
			if(xxx[hang_player+1][lie_player]==' '&&xxx[hang_lr+1][lie_lr]=='#'){
				xxx[hang_player][lie_player]=' ';
				hang_player++;
				xxx[hang_player][lie_player]='M';
			}
			if(xxx[hang_player+1][lie_player]=='#'&&xxx[hang_lr+1][lie_lr]==' '){
				xxx[hang_lr][lie_lr]=' ';
				hang_lr++;
				xxx[hang_lr][lie_lr]='%';
			}
		}
		if (hang_lr==3&&lie_lr==5)
		{
			Sleep(100);
			coutAIO("干得好!你已经学会了基本操作,祝你好运!",3);
			Sleep(2000);
			break; 
		}
		if (hang_player==3&&lie_player==5)
		{
			Sleep(100);
			coutAIO("你被炸死了,请掌握规律",3);
			Sleep(2000);
			exit(0);
		}
		system("cls");
		for(int i=0;i<=10;i++)
			puts(xxx[i]);
	}
}
int main()
{
    coutAIO("要不要全屏(推荐全屏)?输入要或不要");
	string ytytyty;
	cin>>ytytyty;
	if (ytytyty=="要") {
		full_screen();
	}
    srand((unsigned)time(NULL));
    system("title 走迷宫");
	system("color f0");
	coutAIO("你眼里作者们帅不帅?",3);
    string a;
    cin >> a;
    if(a=="quasmajshsuhsjashasznjajazuozheshuaibi!shagsyqshqsyuqhsush&^$@$%^&*^#@!@#$%^&*()*&^%$#@!@#$%^&*(~!!!!!!!"||a=="我是作者你是神魔人"||a=="SBisme"||a=="帅死了helaxnhsnahaioshuwhsjsjajshuwhsuqu%^#"){
        coutAIO("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈……");
        Sleep(1000);
        system("cls");
        coutAIO("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈……");
        Sleep(1000);
        system("cls");
        coutAIO("竟然知道密码?这只是个样子而已,快退出吧!不然我放病毒了!给你五秒钟");
        Sleep(5000);
        system("cls");
	    if ( MessageBox(NULL, "我再问一句,你是不是聪明的?","问题", MB_ICONQUESTION|MB_YESNO) == IDYES );
	    else{
	        coutAIO("你也太不自信了吧!",3,1);
	        return 0;
	    }
		if (MessageBox (NULL, "你想玩下大神做的游戏么?我现在不放病毒,给你一个机会(胆小慎入,可能有病毒哦~)", "作者们", MB_YESNO) == IDYES) {
		    coutAIO("能闯过前面的关卡,你是个大胆、有自信、又懂代码的人!",3,1);
		}
		else {
		    coutAIO("胆小鬼!",3,1);
			return 0;
		}
        coutAIO("游戏正式开始!!!!!",5);
    }
    else{
        coutAIO("不会暗号的一边去!!!!!!!!!!!!!!");
        goto dad;
    }
    startone:
    start(4);
	while(1)
	{
		long long xx=1,yy=1;
		system("cls");
		f='y';
		cout<<"\n\n\n\n\n\n\n\n\n\n\n";
		cout<<"                                                      迷宫游戏,注意全屏,每次获得钥匙和减血都可能使世界改变颜色!!!\n";
		cout<<"                                                   按空格开始游戏\n";
		cout<<"                                                    按0退出游戏\n";
		cout<<"                                                    按1换皮肤\n";
		cout<<"                                                    按2游戏说明\n";
		cout<<"                                                    按3换颜色\n";
		cout<<"\n\n\n\n\n\n\n";
		cout<<"                                                     原创:饼干,改编:努力的AIO";
		long long ok=getch();
		while(ok!='0'&&ok!='1'&&ok!='2'&&ok!=' '&&ok!='3')ok=getch();
		switch(ok)
		{
			case ' ':
				break;
			case '0':
				tc();
				return 0;
				break;
			case '1':
				hf();
				f='n';
				break;
			case '2':
				sm();
				f='n';
				break;
			case '3':
				hys();
				f='n';
				break;
		}
		while(f=='y')
		{
		    xsjc();
			system("cls");
			string a[n];
		    long long x,y,qx,qy;
		    long long ch;
			srand(time(0));
			
			switch(s)
			{
				case 1:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="###########";
		    	    a[1]="#   *   #@#";
		    	    a[2]="# #   #   #";
					a[3]="# ##0## ###";
					a[4]="# #???###Z#";
					a[5]="#???#?????#";
					a[6]="###########";
					a[7]="##障碍之地#";
					a[8]="###########";
		    		break;
		    	case 2:
		    	    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=8;
					qy=12;
					a[0]="####################";
					a[1]="#Z   #       #     #";
					a[2]="# ##   #### ###  # #";
					a[3]="#  ####      ##### #";
					a[4]="###   # # ##    +  #";
					a[5]="##### #######V##@# #";
					a[6]="#     ## ###   <#  #";
					a[7]="## ##^   <## 0 ## ##";
					a[8]="#      <     #     #";
					a[9]="####################";
				   a[10]="######黑暗森林######";
				   a[11]="####################";
					break;
				case 3:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1; 
					a[0]="###V###V#V#V###0###";
					a[1]="# #   #   #   #   #";
					a[2]="# # # # # # # # # #";
					a[3]="# # # # # # # # # #";
					a[4]="# # # # # # # # # #";
					a[5]="# - - - - - - - - #";
					a[6]="# # # # # # # # # #";
					a[7]="# # # # # # # # # #";
					a[8]="# # # # < # # # # #";
					a[9]="# # # # # # # # # #";
				   a[10]="#   +   #   #   #Z#";
				   a[11]="#^#^ ^#^#^#^#^+^###";
				   a[11]="#^#^+^#^小心1^+^###";
				   a[11]="#^#^#^#^#^#^#^#^###";
					break;
				case 4:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="#####################V################V#";
					a[1]="#                                      #";
					a[2]="# ###*###################*############ #";
					a[3]="# #                                  # #";
					a[4]="# # #####0########*####### ##### ####V*#";
					a[5]="# # #Z        #     #    # ##*         #";
					a[6]="# # # # # ##*###### # #### ##  #### ## #";
					a[7]="# # # # # ##        #      ## ##  #  # #";
					a[8]="# # # ### ## # # ########### ##  ##  # #";
					a[9]="# # # # #    # # # #       @#    #   # #";
				   a[10]="# # ### ###### ### # ######## ##### ## #";
				   a[11]="# # * #        -   #              #  # #";
				   a[12]="# # # ######## ############## #####  # #";
				   a[13]="# # >                                # #";
				   a[14]="# # ######*########################### #";
				   a[15]="# #                                  # #";
				   a[16]="# #############V########*#######^##### #";
				   a[17]="#                                      *";
				   a[18]="#*#######################*##############";
				   a[19]="#*###########小心2#######*##############";
				   a[20]="#*#######################*##############";
				    break;
				case 5:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="########################################";
					a[1]="#                      #               #";
					a[2]="# <########## ################# ###### #";
					a[3]="#           # #               # ##   # #";
					a[4]="# # # #### ## # ## # #### ##### ## # # #";
					a[5]="# # # #       #  # #    #        # # # #";
					a[6]="# # #  #### ###### ############### #   <";
					a[7]="# # ##    #      # >               # # #";
					a[8]="# #  #### ######## <^^^^^^^####### # # #";
					a[9]="# ##    #      0 # < BOSS关VVVV>   # # #";
				   a[10]="#    ######### #   < 危险  >     ### # #";
				   a[11]="#*#     #        # < 地带 1> ##### # # #";
				   a[12]="#   <#############VVVVVVVVV> #     # # #";
				   a[13]="# # #                        # ## #  #@#";
				   a[14]="# ### #### #####?>  <##?####^# #### 0#^#";
				   a[15]="#     #    >      OO              #   Z#";
				   a[16]="################0(00)##############0####";
					break;
				case 6:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="##########################";
					a[1]="#                        #";
					a[2]="# ###################### #";
					a[3]="# #*   *   *   *   *   * #";
					a[4]="# #  *   *   *   *   *   #";
					a[5]="### #####################";
					a[6]="#                        #";
					a[7]="# ###################### #";
					a[8]="# >               *   *# #";
					a[9]="#@# ####*####*  *   *    #";
				   a[10]="##           Z############";
				   a[11]="##0##*####################";
				   a[12]="##^##*######地雷阵1#######";
				   a[13]="##^##*####################";
					break;
				case 7:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="#############################################################";
					a[1]="# ###+#                                                   #+#";
					a[2]="# #  ###### ##############################################  #";
					a[3]="# # # #   # #                                             ###";
					a[4]="# # # # # #   # ########################################### #";
					a[5]="# # # # # ##### #                                           #";
					a[6]="# # # # #       # ######################################### #";
					a[7]="# # # # #########                                         # #";
					a[8]="# # # # ################################################  # #";
					a[9]="# # # # #***********************************************#*# #";
				   a[10]="# # # # #ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ # #";
				   a[11]="# # # # #***********************************************# # #";
				   a[12]="# # # # ################################### ############# # #";
				   a[13]="# # # # #                                  #           ## # #";
				   a[14]="# # # # # ##### ###############0# ####################    # #";
				   a[15]="# # # # # #  ## #               # #   *   *   *   *   *## # #";
				   a[16]="# # # # # #+#   # ############# # # *   *   *   *   *     * #";
				   a[17]="# # # # # #######  *   *   #  # # # ####################### #";
				   a[18]="# # #+# #            *   * @#+# #      <################### #";
				   a[19]="# # ### ####################### ########################### #";
				   a[20]="#                                                           #";
				   a[21]="#^###########################################################";
				   a[21]="#^########################地雷阵2######注意生命大于十三######";
				   a[21]="#^###########################################################";
				   break;
				case 8:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="#############################################################";
					a[1]="# ###                                                     #@#";
					a[2]="# #   ##### ##############################################  #";
					a[3]="# # # #   # #                                              0#";
					a[4]="# # # # # #   # ##########################################  #";
					a[5]="# # # # # ##### #                                           #";
					a[6]="# # # # #       - ######################################### #";
					a[7]="# # # # #########                                         # #";
					a[8]="# # # # ################################################  # #";
					a[9]="# # # # #+++++++++++++++++++++_______+++++++++++++++++++### #";
				   a[10]="# # # # #+++++++++++++++++++++|死|地|++++++++++++++++++** # #";
				   a[11]="# # # # #+++++++++++++++++++++|__|__|+++++++++++++++++++# # #";
				   a[12]="# # # # ######################VVVVVVV#############V###### # #";
				   a[13]="# # # # #                                              ## # #";
				   a[14]="# # # # # #####V######################################    # #";
				   a[15]="# < < < < # # #                   <   <   <   <   <   *## # #";
				   a[16]="# # # # # #+#   # ############# <   <   <   <   <   < Z>    #";
				   a[17]="# # # # # ##### <VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^#";
				   a[18]="#   #   # ####*                                            V#";
				   a[19]="#^#^#^#^# VVVV^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV>  #";
				   a[20]="#########                                                   0";
				   a[21]="#############################################################";
				   a[22]="############################### 刺刀阵 ######################";
				   a[23]="#############################################################";
					break;
				case 9:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
					a[0]="##########################";
					a[1]="#                        #";
					a[2]="# ###################### #";
					a[3]="# #Z   #+#        #   #  #";
					a[4]="#  #   # #   #       #   #";
					a[5]="##### ###   #V###### ## ##";
					a[6]="#     #   ###      #    ##";
					a[7]="# ######V#V## *### ## ####";
					a[8]="#     #  #    #    ##    #";
					a[9]="## ##### # #### ######## #";
					a[10]="##         ####         @#";
					a[11]="########0#################";
					break;
				case 10:
				    if(shengming!=20)
				    {
				        shengming++;
				    }
					qx=1;
					qy=1;
				    a[0]="#################################################################################################V################";
					a[1]="#     ?                          ?                               ?      ?              ?                ?        #";
					a[2]="# # 0#######################V#################################^################################################# #";
					a[3]="# #  ###       #############             ?                   ?             ?          ?               ###     ?  #";
					a[4]="# ##  ## ^^^^^^           +# ##*#####*#####*#########################0################################ # # #V# # #";
					a[5]="# ###  # ################### # # # # #                        ?                                      < # # #   # #";
					a[6]="# ####           -       ? ?     <##################^^^^^^^^^*?????################################# # #   # # # #";
					a[7]="# ##########################^##########         ############V#####                               ##  # ##### # # #";
					a[8]="# *#####     ?                          < #####   #########>       + ########################### ## ##       < # #";
					a[9]="# #      0######## ##################### #     ##          # ####################>     ############  #^####### # #";
				   a[10]="# # ##### ?      # ######       #危险!  # #######  #*###### #                     ###                       # # #";
				   a[11]="# #     # ###### # ####   ##### ##########       #@#         # ##### #######*######   <##################### # ###";
				   a[12]="# ##### # *   ## # *### ##            #    ##### ############# #######              <     #                  # #Z#";
				   a[13]="# #   # #   # ## # ##   #  #0#####*#### ## #   # #        #            ^^^^^^^^^^^^^ ^##### ################ # # #";
				   a[14]="# # # # ##### ## # ## ##  #   #   #   # ##   # # # ###### # ######### #  危险地带超级boss#############  ###  ### #";
				   a[15]="#?# # # ?     ## # #  #     #   #   #   #####  #       #  # #         <###******####>>>>>*********#            # #";
				   a[16]="# ### ########## # #?########0###########V#####V######### # ################**###################  ############# #";
				   a[17]="# #              #       ##                               0           ????                    0###            - O#";
				   a[18]="> # ###V####*#####^######## #####*####*#####*##############0#0##############*#########^###### <################# #";
				   a[19]="0             ?     ?      #  #                 ?                      ?   ?        -           -     ?   -      # ";
				   a[20]="######################^###################################################0########0##########0###################";
				   break;
			    case 11:
				    shengming=20;
					qx=3;
					qy=3;
				    a[0]="####################################V####|||######V###############################################################";
					a[1]="#  ?  ?  ?    ?  ?????      *#######    <=V=>#####                      ##########################################";
					a[2]="#?######################### ######## ## ##V####### ####################  #########################################";
					a[3]="#    ##V################### ###V  <# ## ##V####### #                 <#  ########################################";
					a[4]="#0##>   ################### ### # #V ## ##V####### # ###############  @##  #######################################";
					a[5]=">     # ###>                ### # #  <# ##V####### # ##################### #######################################";
					a[6]="# ###^# #### #V#########V##^### # # ### V######### >D                      #######################################";
					a[7]="# ####*      #    ?  <##        < # ### V##V######*###############################################################";
					a[8]="# ##########^# ##### ### ########   <## 0#########             ? ? ?##############################################";
					a[9]="#        ?   0 0     ### ###V####^##### V##V###### ################ ##############################################";
				   a[10]="#^#######0#0 # # ###^#V>     ####     # V##        <####   #    #   #######################################V######";
				   a[11]=">         ## * # ####>?  ?<# ########## ##V ###### ####  # # ## # ##########################>               ######";
				   a[12]="# ###V### ##   #     < ##    <>         ##V V##### ###  ## # ##   ######################################### ######";
				   a[13]="# ###   < ##^#^#^### # ##^#V### #######0### V##### ##  ##    ############################################## ######";
				   a[14]="# ### # # >          0    ? ###           < V##### #  # ####V############################################## ######";
				   a[15]="# ### #?# # #V######^V##### ###^########V V ###### # #     # ##################V########################### ######";
				   a[16]="#     < # # #      <#    0# ############V   <##### #   ### < ##################                             <#####";
				   a[17]="#^##### >   # #### ## ## ## #############^######## ###>    >                    ##################################";
				   a[18]=">       ###^# #### ## ## ## ###########V##V####### #    ##^##V################# ##################################";
				   a[19]="# #####^##### #### ## ## ## ############V##V###### #                            <                               <#";
				   a[20]="# ???? ???  ? <###    <#    0############V######## #^^^^##########################################################";
				   a[21]="#^################^#####^#########################??           <######<########<######<####<####<####<######/|####";
				   a[23]="<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<^?<<<<?<<<<<<<<<<<<<<<<<<<<<<V<<<<<<<<<<<<<<<<<<<<<<<<<<<<<|####";
				   a[24]="F                -   -        -       -     -           ^               -     ??????????  D        ########关|####";
				   a[25]="#####*# ######## # ### # ###### # ### # ##*   ##V##### ##################V##### ################## #######BOSS####";
				   a[26]="#>    # ####V##*   ##*   #####*   ### # #V######    <  # #  #######>            *###################### 超级无敌 #";
				   a[27]="## ## #    <    <#*V####^#####V##^##>   #        <# # #V ###########V#### #############################不错,菜鸡#";
				   a[28]="## ## #^## # ###V##          <    <####^# #######>  V##              <### #############################你如果这关#";
				   a[29]="## #>      >     ## V####### # ##         <        ^    <####V###### #### #########小心D有时地刺呦#####赢了,你就#";
				   a[30]="## ######V^####>     >       # ##^#######>  V#####^  <# ####>        <### ###########D是陷阱!##########晋级为一级#";
				   a[31]="## ######       <### # #####^# >           ^        >   ##### ######^#### #################################了#####";
				   a[32]="##        <####      <         < #########^  <####### #^####>             <###############################!  !####";
				   a[33]="##^############^######^#########            <########        *##########^################################/####/###";
				   a[34]="################################^####################^####################################################----####";
				case 12:
				    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_BLUE); 
					cout << "你赢了!!!!!!!!!!!!!!!!!!!" << endl;
					return 0;
			}
			xx=x=qx,yy=y=qy;
			a[x][y]=p[r];
		    print(a);
		    while(true)
		    {
		        cout << "生命:" << shengming << endl;
		        cout << "步数:" << bushu << endl;
		        cout << "等级:" << dengji << endl;
		        ch=getch();
		        if((ch=='a'&&a[x][y-1]=='?')||(ch=='d'&&a[x][y+1]=='?')||(ch=='s'&&a[x+1][y]=='?')||(ch=='w'&&a[x-1][y]=='?'))
		        {
		            if(ch=='a'&&a[x][y-1]=='?')
		            {
		                a[x][y-1]=' ';
		            }
		            if(ch=='d'&&a[x][y+1]=='?')
		            {
		                a[x][y+1]=' ';
		            }
		            if(ch=='s'&&a[x+1][y]=='?')
		            {
		                a[x+1][y]=' ';
		            }
		            if(ch=='w'&&a[x-1][y]=='?')
		            {
		                a[x-1][y]=' ';
		            }
				}
		        bushu++;
		        if(ch=='q')
		        {
		        	xx=x;
		        	yy=y;
				}
				if(ch=='e')
				{
					a[x][y]=' ';
					a[xx][yy]=p[r];
					x=xx;
					y=yy;
				}
		        if(ch=='r')
		        {
		        	a[x][y]=' ';
		        	a[qx][qy]=p[r];
		        	x=qx;
		        	y=qy;
				}
				if(shengming<=0)
		        {
		            siwang();
		            goto startone;
				}
				
		        if(ch=='p')
		        {
		        	f='n';
		        	break;
				}
		        if((ch=='a'&&a[x][y-1]=='Z'&&yaoshi==true)||(ch=='d'&&a[x][y+1]=='Z'&&yaoshi==true)||(ch=='s'&&a[x+1][y]=='Z'&&yaoshi==true)||(ch=='w'&&a[x-1][y]=='Z'&&yaoshi==true))
		        {
		        	break;
				}
				if(ch=='w'&&a[x-1][y]=='V')
		        {
		            coutAIO("你被刺扎了,扣血4滴");
		            shengming-=4;
		            system("pause");
				}
				if(ch=='a'&&a[x][y-1]=='<')
		        {
		            coutAIO("你被刺扎了,扣血4滴");
		            shengming-=4;
		            system("pause");
				}
				if(ch=='d'&&a[x][y+1]=='>')
		        {
		            coutAIO("你被刺扎了,扣血4滴");
		            shengming-=4;
		            system("pause");
				}
				if(ch=='s'&&a[x+1][y]=='^')
		        {
		            coutAIO("你被刺扎了,扣血4滴");
		            shengming-=4;
		            system("pause");
				}
				if((ch=='a'&&a[x][y-1]=='+')||(ch=='d'&&a[x][y+1]=='+')||(ch=='s'&&a[x+1][y]=='+')||(ch=='w'&&a[x-1][y]=='+'))
		        {
		            if(shengming>=20)
		            {
		                coutAIO("你加不了血!");
		            } 
		            else{
		                coutAIO("你加了血!你加了一滴血!");
		                shengming+=1;
		                if(ch=='a'&&a[x][y-1]=='+')
		                {
		                    a[x][y-1]=' ';
		                }
		                if(ch=='d'&&a[x][y+1]=='+')
		                {
		                    a[x][y+1]=' ';
		                }
		                if(ch=='s'&&a[x+1][y]=='+')
		                {
		                    a[x+1][y]=' ';
		                }
		                if(ch=='w'&&a[x-1][y]=='+')
		                {
		                    a[x-1][y]=' ';
		                }
		            }
		            system("pause");
				}
				flag:
				if((ch=='a'&&a[x][y-1]=='@')||(ch=='d'&&a[x][y+1]=='@')||(ch=='s'&&a[x+1][y]=='@')||(ch=='w'&&a[x-1][y]=='@'))
		        {
		            system("cls");
		            coutAIO("你得到了钥匙!!");
		            yaoshi=true;
		            if(ch=='a'&&a[x][y-1]=='@')
		            {
		                a[x][y-1]=' ';
		            }
		            if(ch=='d'&&a[x][y+1]=='@')
		            {
		                a[x][y+1]=' ';
		            }
		            if(ch=='s'&&a[x+1][y]=='@')
		            {
		                a[x+1][y]=' ';
		            }
		            if(ch=='w'&&a[x-1][y]=='@')
		            {
		                a[x-1][y]=' ';
		            }
		            system("pause");
				}
				int d=rand()%100;
				bool s=false;
				if((d<=30&&ch=='a'&&a[x][y-1]=='D')||(d<=20&&ch=='d'&&a[x][y+1]=='D')||(d>=50&&ch=='s'&&a[x+1][y]=='D')||(d>=70&&ch=='w'&&a[x-1][y]=='D')||(d<=50&&a[x][y]=='D'))
		        {
		            s=true;
		        } 
		        if(s){
		            shengming--;
		        }
				if((ch=='a'&&a[x][y-1]=='*')||(ch=='d'&&a[x][y+1]=='*')||(ch=='s'&&a[x+1][y]=='*')||(ch=='w'&&a[x-1][y]=='*'))
		        {
		            coutAIO("你触发了炸药!你被炸药炸到了,扣血10滴");
		            shengming-=10;
		            if(ch=='a'&&a[x][y-1]=='*')
		            {
		                a[x][y-1]=' ';
		            }
		            if(ch=='d'&&a[x][y+1]=='*')
		            {
		                a[x][y+1]=' ';
		            }
		            if(ch=='s'&&a[x+1][y]=='*')
		            {
		                a[x+1][y]=' ';
		            }
		            if(ch=='w'&&a[x-1][y]=='*')
		            {
		                a[x-1][y]=' ';
		            }
		            system("pause");
				}
				if((ch=='a'&&a[x][y-1]=='-')||(ch=='d'&&a[x][y+1]=='-'))
		        {
		            a[x][y]=' ';
		        	coutAIO("你被刺穿了,扣血5滴,但穿越了");
		            shengming-=5;
		            system("pause");
		            if(ch=='a'&&a[x][y-1]=='-')
		            {
		                a[x][y-=2];
		            }
		            if(ch=='d'&&a[x][y+1]=='-')
		            {
		                a[x][y+=2];
		            }
				}
				if((ch=='a'&&a[x][y-1]=='0')||(ch=='d'&&a[x][y+1]=='0')||(ch=='s'&&a[x+1][y]=='0')||(ch=='w'&&a[x-1][y]=='0'))
		        {
		            system("cls");
		            coutAIO("你在下一回合会死去!!");
		            shengming=0;
		            if(ch=='a'&&a[x][y-1]=='0')
		            {
		                a[x][y-1]=' ';
		            }
		            if(ch=='d'&&a[x][y+1]=='0')
		            {
		                a[x][y+1]=' ';
		            }
		            if(ch=='s'&&a[x+1][y]=='0')
		            {
		                a[x+1][y]=' ';
		            }
		            if(ch=='w'&&a[x-1][y]=='0')
		            {
		                a[x-1][y]=' ';
		            }
		            system("pause");
				}
		        if(ch==27)break;
		        if(ch==97&&a[x][y-1]==' '||a[x][y-1]=='D')
				{
		            a[x][y]=' ';
		            y--;
		            a[x][y]=p[r];
		        }
		        if(ch==100&&a[x][y+1]==' '||a[x][y-1]=='D')
				{
		            a[x][y]=' ';
		            y++;
		            a[x][y]=p[r];
		        }
		        if(ch==115&&a[x+1][y]==' '||a[x][y-1]=='D')
				{
		            a[x][y]=' ';
		            x++;
		            a[x][y]=p[r];
		        }
		        if(ch==119&&a[x-1][y]==' '||a[x][y-1]=='D')
				{
		            a[x][y]=' ';
		            x--;
		            a[x][y]=p[r];
		        }
		        print(a);
		    }
		    system("cls");
		    if(f=='n')break;
		    cout<<"you win!!!"<<endl;
		    bushu=0;
		    cout<<"按空格继续···";
		    s++;
		    yaoshi=false;
		    ok='\0';
		    while(ok=getch(),ok!=' ');
			system("cls");
		    cout<<"是否继续(y/n)";
		    while(f=getch(),f!='y'&&f!='n');
		}
	}
	dad:
    return 0;
}



别忘了点赞欧~

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值