#include<iostream>
#include<string>
#include<conio.h>
#include<map>
#include<cmath>
#include<Windows.h>
#include<cstdlib>
using namespace std;
void nw(int &b,int &c,bool &win){
char x[122][122]={
{' ','_','_','_','_','_','_','_','_','_','_','_','_','_','_',' '},
{'|',' ',' ',' ','|',' ','|',' ','|',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ','|',' ','|',' ','|',' ','|',' ',' ',' ',' ','|'},
{'|','_','_',' ','|',' ','|',' ',' ',' ','|','_','_',' ',' ','|'},
{'|',' ',' ',' ',' ',' ','|',' ',' ',' ',' ',' ','|',' ',' ','|'},
{'|',' ',' ',' ','|',' ','|','_','_','_',' ',' ','|','_',' ','|'},
{'|','_','_','_','|',' ','|',' ',' ',' ',' ',' ','|',' ',' ','|'},
{'|',' ',' ',' ','|',' ','|','_','_','_',' ','_','|','_',' ','|'},
{'|',' ','|',' ',' ',' ',' ',' ','|',' ',' ',' ',' ','|',' ','|'},
{'|',' ','|',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','|','z','|'},
{'|','_','|','_','_','_','|','_','_','_','_','_','_','|','_','|'},
};
if(!(x[b][c]=='_'||x[b][c]=='|')){
x[b][c]='+';
}else{
b=1,c=1;
}
cout<<"第一关\n";
if(x[b][c]=='z') b=200;
for(int i=0;i<11;i++){//s
for(int j=0;j<16;j++){//h
cout<<x[i][j];
}
cout<<endl;
}
cout<<endl<<"位置:"<<b<<','<<c<<endl;
}
void nc(int &b,int &c,bool &win){
char x[122][122]={
{' ','_','_','_','_','_','_','_','_','_','_','_','_','_','_',' '},
{'|',' ','|',' ','|',' ',' ',' ','|',' ',' ',' ',' ',' ',' ','|'},
{'|',' ','|',' ','|',' ','|',' ','|',' ','|',' ','|',' ',' ','|'},
{'|',' ','|',' ','|',' ','|',' ','|',' ','|','_','|',' ','_','|'},
{'|',' ','|',' ',' ',' ','|',' ','|',' ',' ',' ','|',' ',' ','|'},
{'|',' ','|',' ','|',' ','|',' ','|','_',' ',' ','|','_',' ','|'},
{'|',' ','|',' ','|',' ','|',' ',' ',' ',' ',' ','|',' ',' ','|'},
{'|',' ','|',' ','|',' ','|','_','_','_',' ','_','|','_',' ','|'},
{'|',' ',' ',' ','|',' ','|',' ','|',' ',' ',' ',' ','|',' ','|'},
{'|',' ','|',' ','|',' ','|',' ',' ',' ',' ',' ',' ','|','z','|'},
{'|','_','_','_','_','_','|','_','_','_','_','_','_','|','_','|'},
};
if(!(x[b][c]=='_'||x[b][c]=='|')){
x[b][c]='+';
}else{
b=1,c=1;
}
cout<<"第二关\n";
if(x[b][c]=='z') b=200;
for(int i=0;i<11;i++){//s
for(int j=0;j<16;j++){//h
cout<<x[i][j];
}
cout<<endl;
}
cout<<endl<<"位置:"<<b<<','<<c<<endl;
}
void nl(int &b,int &c,bool &win){
char x[122][122]={
{' ','_','_','_','_','_','_','_','_','_','_','_','_','_','_',' '},
{'|',' ',' ',' ',' ',' ',' ','|',' ',' ',' ','|',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ','|',' ',' ',' ','|',' ','|',' ','|'},
{'|','_','_','_','_','_',' ','|',' ','|',' ',' ',' ','_',' ','|'},
{'|',' ',' ',' ',' ',' ',' ','|',' ','|','_','_','_',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ','|',' ',' ',' ',' ','|',' ',' ','|'},
{'|',' ','_','_','_','_','_','|',' ','|','_',' ','|',' ',' ','|'},
{'|',' ',' ','|',' ',' ',' ','|',' ','|',' ',' ','|',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ','|',' ','|',' ','_','|',' ',' ','|'},
{'|',' ',' ',' ',' ','|',' ',' ',' ','|',' ',' ','|',' ','z','|'},
{'|','_','_','_','|','|','_','_','_','|','_','_','|','_','_','|'},
};
if(!(x[b][c]=='_'||x[b][c]=='|')){
x[b][c]='+';
}else{
b=1,c=1;
}
cout<<"第三关\n";
if(x[b][c]=='z') b=200;
for(int i=0;i<11;i++){//s
for(int j=0;j<16;j++){//h
cout<<x[i][j];
}
cout<<endl;
}
cout<<endl<<"位置:"<<b<<','<<c<<endl;
}
int main(){
int level=1;
bool win=1;
char a;
int b=1,c=1,d;
while(1){
a=getch();
system("cls");
if(b==200) return 0;
if(a=='w'){
b--;
}
if(a=='s'){
b++;
}
if(a=='d'){
c++;
}
if(a=='a'){
c--;
}
if(a=='b'){
break;
}
if(b==9&&c==14&&level==1){
level++;
b=1,c=1;
}
if(b==9&&c==14&&level==2){
level++;
b=1,c=1;
}
if(b==9&&c==14&&level==3){
cout<<"你赢了";
return 0;
}
if(level==1) nw(b,c,win);
if(level==2) nc(b,c,win);
if(level==3) nl(b,c,win);
}
return 0;
}//
