胎神游戏集第二期

11 篇文章 0 订阅
5 篇文章 0 订阅

延续上一期

一、海岛奇胎

#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<time.h>
using namespace std;
typedef BOOL (WINAPI *PROCSETCONSOLEFONT)(HANDLE, DWORD);
PROCSETCONSOLEFONT SetConsoleFont;
POINT Windowpos(){POINT pt;GetCursorPos(&pt);HWND h=GetForegroundWindow();ScreenToClient(h,&pt);pt.x=(pt.x+4)/10+0.5;pt.y=pt.y/8+0.5;swap(pt.x,pt.y);return pt;}
int mouse;POINT pt;float kx,ky;int ti(float a) {return ((int)(a*10+5))/10;}
void Print(int a){HMODULE hKernel32 = GetModuleHandle("kernel32");SetConsoleFont = (PROCSETCONSOLEFONT)GetProcAddress(hKernel32,"SetConsoleFont");SetConsoleFont(GetStdHandle(STD_OUTPUT_HANDLE),a);}
void Setpos(float x,float y){COORD pos;pos.X=ti(y*4)/2;pos.Y=ti(x);SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}
//Setpos中,横5和竖5是一样的长度,在C,N中我们把y*2存入,/2输出 ,所以 支持4.5 
struct node {float x,y,fx,fy;int kind,staytime,blood,CD,enemy,turn=6;bool life;} M[100001],E[100001];//Mytower Enemy Bullet
struct bullet {float x,y,vx,vy,h;int kind,staytime,enemy,endx,endy,up;bool life;} B[100001];//,ice,medical,durg,
float Espeed[7]=    {-1,    0.14,   0.2,    0.08,   0.3,    0.3,    0.1};//敌人速度 
float Bspeed[7]=    {-1,    0.6,    0.6,    0.6,    1,      0.1,    0.6};//打塔的子弹速度 
float Bfspeed[7]=   {-1,    0.4,    0.4,    -1,     0.3,    1,  0.4};//打敌的子弹速度 
float MR[7]=        {-1,    12,     10,     25,     8,      15,     20};
float ER[7]=        {-1,    5,      1.8,    8,      7,      1,      10};
int MCDmax[7]=      {10000, 10,     7,      60,     2,      90,     50};
int ECDmax[7]=      {-1,    30,     10,     40,     25,     1,      40};
int Mblood[7]=      {-1,200,150,300,250,400,300};
int Eblood[7]=      {-1,50,100,30,100,10,200};
bool Zhan[50][50];
//Pk_Pb : personkill_or_placeboom
int m[51][101],n[51][101],o[51][101],T,CD,CDmax,Day,ml,mr,el,er,bl,br,money,Level=1,endless;
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);
}
void C(int i,int j){Color(0);
    Setpos(i,j/2.0);int N=n[i][j];if(N==-1) printf(" ");if(N>=0&&N<=9) printf("%d",N);
    if(N==-2) printf("+");if(N==-3) Color(5),printf("+"),n[i][j]=-1,o[i][j]=4;if(N==-4) Color(3),printf("+"),n[i][j]=-1,o[i][j]=4;
    //以下字符占2格 
    if(N==11) Color(1),printf("О");if(N==13) Color(3),printf("◎");if(N==14) Color(4),printf("+");if(N==16) Color(5),printf("◎");
    if(N==-11) Color(1),printf("⊙");if(N==-12) Color(2),printf("⊙");if(N==-13) Color(3),printf("⊙");if(N==-14) Color(4+rand()%2),printf("█");if(N==-15) Color(1),printf("●");if(N==-16) Color(5),printf("¤");
    if(N==49) Color(0),printf("营");if(N==50) Color(0),printf("墙");if(N==51) Color(1),printf("●");if(N==52) Color(2),printf("■");if(N==53) Color(3),printf("▲");if(N==54) Color(4),printf("▼");if(N==55) Color(6),printf("◆");if(N==56) Color(5),printf("★");
    if(N==81) Color(1),printf("○");if(N==82) Color(2),printf("□");if(N==83) Color(3),printf("△");if(N==84) Color(4),printf("▽");if(N==85) Color(6),printf("◇");if(N==86) Color(5),printf("☆");
    if(N==1001)  printf("╔");//if(N==1002)  printf("╦");
    if(N==1003)  printf("╗");if(N==1004)  printf("╠");if(N==1005)  printf("╣");if(N==1006)  printf("╚");if(N==1007)  printf("╩");if(N==1008)  printf("╝");
    if(N==1011)  printf("↖");if(N==1012)  printf("↑");if(N==1013)  printf("↗");if(N==1014)  printf("←");if(N==1015)  printf("→");if(N==1016)  printf("↙");if(N==1017)  printf("↓");if(N==1018)  printf("↘");

}
void Map(int a){if(a==1){for(int i=1;i<=50;i++)for(int j=1;j<=100;j++){
if(n[i][j]!=m[i][j]||T%800==0){C(i,j);if(n[i][j]>=50||n[i][j]<=-10) n[i][j+1]=-1,j++;}
if(o[i][j]==1) C(i,j);if(o[i][j]>0) o[i][j]--;
}
for(int i=1;i<=50;i++)for(int j=1;j<=100;j++){m[i][j]=n[i][j];}}
}
void N(float x,float y,int w){int xx=(int)(x+0.5),yy=(int)(y*2.0+0.5);if(xx>49||yy>98||xx<1||yy<1) return;else n[xx][yy]=w;}
int Turn[9][2]={{0,0},{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
void Circle(int x,int y,int kind,int ex)
{int R;
    if(kind==1){int k=M[ex].kind;R=MR[k];int next=20-0.5*R;
    for(int i=0;i<=360;i+=next) N(x+R*sin(3.1416*i/180),y+R*cos(3.1416*i/180),-2);
    if(k==3) for(int i=0;i<=360;i+=15) R=10,N(x+R*sin(3.1416*i/180),y+R*cos(3.1416*i/180),-2);
    }
    if(kind==-1){int k=M[ex].kind;R=MR[k];int next=20-0.5*R;
    for(int i=0;i<=360;i+=next) N(x+R*sin(3.1416*i/180),y+R*cos(3.1416*i/180),-1);
    if(k==3) for(int i=0;i<=360;i+=15) R=10,N(x+R*sin(3.1416*i/180),y+R*cos(3.1416*i/180),-1);
    }
    if(kind==2){R=ex;int next=20-0.5*R;
    for(int i=0;i<=360;i+=next) N(x+R*sin(3.1416*i/180),y+R*cos(3.1416*i/180),-3);
    }
    if(kind==-2){R=ex;int next=20-0.5*R;
    for(int i=0;i<=360;i+=next) N(x+R*sin(3.1416*i/180),y+R*cos(3.1416*i/180),-4);
    }
}
void Cout(int a,int kind){
    if(kind==1)//炮台
    {
        float x=M[a].x,y=M[a].y;
        N(x,y,M[a].kind+50);
        if(a==1) N(x,y,49);
        int i=1;if(M[a].blood>=100) i=2;
        for(i;i<=8;i++) N(x+Turn[i][0],y+Turn[i][1],1000+i),Zhan[(int)x+Turn[i][0]][(int)y+Turn[i][1]]=1;
        int t=M[a].turn;
//      N(Turn[t][0],y+Turn[t][1],1010+t);
        int b=max(0,M[a].blood),bb=0;while(b>0){bb++;N(x-1,y+1-0.5*bb,b%10);b/=10;}
    }
    if(kind==2)//人 
    {
        float x=E[a].x,y=E[a].y;
        N(x,y,E[a].kind+80);
        N(x+1,y,1012);//
        Zhan[(int)x][(int)y]=Zhan[(int)x+1][(int)y]=1;
//      N(x+1,y,1010+E[a].turn);
        int b=max(0,E[a].blood),bb=0;while(b>0){bb++;N(x-1,y+1-0.5*bb,b%10);b/=10;}
    }
    if(kind==3)//对塔子弹 
    {
        float x=B[a].x,y=B[a].y;
        N(x,y,10+B[a].kind);
    }
    if(kind==4)//对人子弹 
    {
        float x=B[a].x,y=B[a].y;
        N(x-B[a].h,y,-10+B[a].kind);
    }
}
int Find_enemy(int Who,int good_or_bad){
    int ans=-1,r=rand()%2;float ansx=1e9,x;//搜敌人 
if(good_or_bad>=1){float X=M[Who].x,Y=M[Who].y;
    if(good_or_bad==2) X=E[Who].x,Y=E[Who].y;
    for(int i=el;i<=er;i++){if(E[i].life==0) continue;x=sqrt((E[i].x-X)*(E[i].x-X)+(E[i].y-Y)*(E[i].y-Y));
    if(good_or_bad==2&&E[i].kind==4) continue;
    if(M[Who].kind==3&&x<10) continue;//迫击炮 
    if(M[Who].kind==6&&ans!=-1&&ansx>x) ansx=x;//火箭炮
    if(ansx>x) ansx=x,ans=i;
    if(ansx==x) {int r=rand()%2;if(r==1) ansx=x,ans=i;}}}
    if(good_or_bad==0){float X=E[Who].x,Y=E[Who].y;for(int i=ml;i<=mr;i++) {if(M[i].life==0) continue;x=sqrt((M[i].x-X)*(M[i].x-X)+(M[i].y-Y)*(M[i].y-Y));if(ansx>x) ansx=x,ans=i;if(ansx==x) {int r=rand()%2;if(r==1) ansx=x,ans=i;}}}
    return ans;
}
void Find_boomkill(int Who,float r,bool good_or_bad,int kill){
    float x,X=B[Who].x,Y=B[Who].y;int kk=(float)kill/2.5;kill+=rand()%kk-kk/5;
    if(good_or_bad==1){for(int i=el;i<=er;i++){if(E[i].life==0) continue;x=sqrt((E[i].x-X)*(E[i].x-X)+(E[i].y-Y)*(E[i].y-Y));if(r>=x) E[i].blood=min(E[i].blood-kill,Eblood[E[i].kind]+Day+50);}
}//搜敌人
    else{for(int i=ml;i<=mr;i++){if(M[i].life==0) continue;x=sqrt((M[i].x-X)*(M[i].x-X)+(M[i].y-Y)*(M[i].y-Y));if(r>=x) M[i].blood-=kill;}
}//搜炮台
}
void Die(){
    for(int i=ml;i<=mr;i++){
        if(M[i].blood<=0) M[i].life=0;
//      if(M[i].life==0&&i==ml) ml++;
    }
    for(int i=el;i<=er;i++){
        if(E[i].blood<=0) E[i].life=0;
//      if(E[i].life==0&&i==el) el++;
    }
    for(int i=bl;i<=br;i++){
        if(B[i].x+B[i].vx<1||B[i].x+B[i].vx>49||B[i].y+B[i].vy<1||B[i].y+B[i].vy>98) {B[i].life=0;}
        if(B[i].staytime>=100) B[i].life=0;
//      if(B[i].life==0&&i==bl) bl++;
    }
//  if(el>er) el=er=0,memset(E,0,sizeof(E));if(bl>br) bl=br=0,memset(B,0,sizeof(B));
}
void Move(int a){
    if(a==2)
    {
    for(int i=ml;i<=mr;i++){if(M[i].life==0) continue;Cout(i,1);}
    for(int i=el;i<=er;i++){if(E[i].life==0) continue;Cout(i,2);}
    return;
    }
    for(int i=ml;i<=mr;i++){
        if(M[i].life==0) continue;
        else{M[i].staytime++;int e=M[i].enemy;if(E[e].life==0) M[i].enemy=-1;

            if(M[i].kind==5&&M[i].enemy==-1&&M[i].CD<=70&&T%2==0) M[i].CD++;
            if(M[i].kind==0&&M[i].blood<=500&&T%20==0) M[i].blood++;
        if(M[i].enemy==-1||M[i].kind==4) M[i].enemy=Find_enemy(i,1);//喷火器 
        if(M[i].enemy!=-1)
    {int k=M[i].enemy;
        float X=M[i].x,Y=M[i].y,Ax=E[k].x-X,Ay=E[k].y-Y;if(Ay==0) Ay=1e-6;float Turnn=abs(Ax/Ay*1.0),Dis=sqrt((E[k].x-X)*(E[k].x-X)+(E[k].y-Y)*(E[k].y-Y));

        if(Dis>MR[M[i].kind]){M[i].enemy=-1;}
        else
        {M[i].CD++;
            if((M[i].kind!=6&&M[i].CD>=MCDmax[M[i].kind])||(M[i].kind==6&&M[i].CD<=21&&M[i].CD%4==0))//火箭炮 
            {
            if(M[i].kind==6) M[i].enemy=Find_enemy(i,1);
            if(Turnn>=sqrt(2)+1){if(Ay>0) M[i].turn=2;else M[i].turn=7;}
            else if(Turnn>=1.0/(sqrt(2)+1)*1.0){if(Ax>0&&Ay>0) M[i].turn=1;else if(Ax<0&&Ay>0) M[i].turn=3;else if(Ax<0&&Ay<0) M[i].turn=8;else M[i].turn=6;}
            else {if(Ax>0) M[i].turn=5;else M[i].turn=4;}
            br++,B[br].x=X,B[br].y=Y;
            B[br].kind=-M[i].kind;///
            B[br].life=1,B[br].enemy=M[i].enemy,B[br].endx=E[M[i].enemy].x,B[br].endy=E[M[i].enemy].y,B[br].staytime=0;
            }
            if(M[i].CD>=MCDmax[M[i].kind]) M[i].CD=0;
        }
    }Cout(i,1);}}
    for(int i=el;i<=er;i++){
        if(E[i].life==0) continue;
        else{E[i].staytime++;E[i].CD++;
        int e=E[i].enemy;if(M[e].life==0||(E[i].kind==4&&E[e].life==0)) E[i].enemy=-1;
//        if(T%100==1) E[i].enemy=-1;
        if(E[i].enemy==-1) {E[i].enemy=Find_enemy(i,0);if(E[i].kind==4) E[i].enemy=Find_enemy(i,2);}
        if(E[i].enemy!=-1){int k=E[i].enemy;int Mkx=M[k].x;int Mky=M[k].y;if(E[i].kind==4) Mkx=E[k].x,Mky=E[k].y;
        float X=E[i].x,Y=E[i].y;float Dis=sqrt((Mkx-X)*(Mkx-X)+(Mky-Y)*(Mky-Y));
        float Ax=Mkx-X,Ay=Mky-Y,S=Espeed[E[i].kind];if(Ay==0) Ay=1e-6;float Turnn=abs(Ax/Ay*1.0);
        if(Dis>ER[E[i].kind]){float vx=Ax*S/Dis*1.0,vy=Ay*S/Dis*1.0;E[i].x+=vx,E[i].y+=vy;}
        else{
        if(E[i].CD>=ECDmax[E[i].kind]){
//        if(Turnn>=sqrt(2)+1){if(Ay>0) E[i].turn=7;else E[i].turn=2;}
//        else if(Turnn>=1.0/(sqrt(2)+1)*1.0){if(Ax>0&&Ay>0) E[i].turn=8;else if(Ax<0&&Ay>0) E[i].turn=6;else if(Ax<0&&Ay<0) E[i].turn=1;else E[i].turn=3;}
//        else {if(Ax>0) E[i].turn=4;else E[i].turn=5;}

        if(E[i].kind==5) E[i].blood=-1;//炮灰 ///
        if(E[i].kind==4){
            br++,B[br].x=X,B[br].y=Y;
            B[br].kind=4;///
            B[br].life=1,B[br].enemy=E[i].enemy,B[br].endx=E[E[i].enemy].x,B[br].endy=E[E[i].enemy].y,B[br].staytime=0;
        }
        else{
        br++,B[br].x=X,B[br].y=Y;
        B[br].kind=E[i].kind;///
        B[br].life=1,B[br].enemy=E[i].enemy,B[br].endx=M[E[i].enemy].x,B[br].endy=M[E[i].enemy].y,B[br].staytime=0;
        }

        E[i].CD=0;}
        }
        }Cout(i,2);
        }
    }
    for(int i=bl;i<=br;i++){
        if(B[i].life==0) continue;
        else if(B[i].kind>0)//对塔子弹 >0
        {
            B[i].staytime++;
            int k=B[i].enemy;
            int Mkl=M[k].life,Mkx=M[k].x,Mky=M[k].y;
            if(B[i].kind==4) Mkl=B[k].life,Mkx=B[k].x,Mky=B[k].y;
            if(k!=-1&&Mkl==1) B[i].endx=Mkx,B[i].endy=Mky;
            float kx=B[i].endx,ky=B[i].endy,X=B[i].x,Y=B[i].y;float Ax=kx-X,Ay=ky-Y,S=Bspeed[B[i].kind];float Dis=sqrt(Ax*Ax+Ay*Ay);float vx=Ax*S/Dis*1.0,vy=Ay*S/Dis*1.0;
            B[i].x+=vx,B[i].y+=vy;//别改,对的! 
            if(Dis<=S){
                //打中了,减血 
                B[i].x=B[i].endx,B[i].y=B[i].endy;
                if(B[i].kind==1) Find_boomkill(i,1.5,0,20),Circle(B[i].endx,B[i].endy,-2,1);
                if(B[i].kind==2) Find_boomkill(i,1.5,0,10),Circle(B[i].endx,B[i].endy,-2,1);
                if(B[i].kind==3) Find_boomkill(i,3,0,20),Circle(B[i].endx,B[i].endy,-2,3);
                if(B[i].kind==4) Find_boomkill(i,2,1,-5),Circle(B[i].endx,B[i].endy,-2,2);
                if(B[i].kind==5) Find_boomkill(i,3,0,50),Circle(B[i].endx,B[i].endy,-2,3);//炮灰 
                if(B[i].kind==6) Find_boomkill(i,2,0,20),Circle(B[i].endx,B[i].endy,-2,2);
                B[i].life=0;continue;
            }
            Cout(i,3);
        }
        else//对人子弹 <0
        {
            B[i].staytime++;
            int k=B[i].enemy;if(k!=-1&&E[k].life==1) B[i].endx=E[k].x,B[i].endy=E[k].y;
            float kx=B[i].endx,ky=B[i].endy,X=B[i].x,Y=B[i].y;float Ax=kx-X,Ay=ky-Y,S=Bfspeed[-B[i].kind];float Dis=sqrt(Ax*Ax+Ay*Ay);float vx=Ax*S/Dis*1.0,vy=Ay*S/Dis*1.0;

            if(B[i].kind==-3){B[i].x+=1.0/(49.0-B[i].staytime)*Ax;B[i].y+=1.0/(49.0-B[i].staytime)*Ay;

            if(T%2==0){
            if(B[i].up==1){if(B[i].h<3) B[i].h++;else if(B[i].h<6) B[i].h+=0.5;else B[i].up++;}else if(B[i].up<=6) B[i].up++;else{if(B[i].h>3) B[i].h-=0.5;else B[i].h--;}}
            }
            else B[i].x+=vx,B[i].y+=vy;//抛物线
            if(B[i].kind==-3&&B[i].staytime>=48) {B[i].x=B[i].endx,B[i].y=B[i].endy,Find_boomkill(i,5,1,30),Circle(B[i].endx,B[i].endy,2,4);B[i].life=0;continue;}
            else if(B[i].kind!=-3&&Dis<=S)//打中了,减血 
            {
                if(B[br].kind==-2) B[i].endx+=rand()%7-3,B[i].endy+=rand()%7-3;//重机枪 
                B[i].x=B[i].endx,B[i].y=B[i].endy;
                if(B[i].kind==-1) Find_boomkill(i,2,1,20),Circle(B[i].endx,B[i].endy,2,2);
                if(B[i].kind==-2) Find_boomkill(i,2,1,20),Circle(B[i].endx,B[i].endy,2,2);
                if(B[i].kind==-4) Find_boomkill(i,2,1,5),Circle(B[i].endx,B[i].endy,2,2);
                if(B[i].kind==-5) Find_boomkill(i,3,1,120),Circle(B[i].endx,B[i].endy,2,3);
                if(B[i].kind==-6) Find_boomkill(i,3,1,40),Circle(B[i].endx,B[i].endy,2,3);
                B[i].life=0;continue;
            }
            Cout(i,4);
        }
    }
    Die();//开始处理 life=0,前面不要有 life=0 
}
void StartWar(int D)
{
  for(int i=-1;i<=(int)T/1000;i++){
    int XY=rand()%4,W=rand()%49+1,x,y,k,R=rand()%100;
    if(Level==2) XY=3;if(Level==3) XY=3*(rand()%2);
    if(XY==0) x=1,y=W;if(XY==1) x=49,y=W;if(XY==2) x=W,y=1;if(XY==3) x=W,y=49;
    k=rand()%6+1;///
    er++,E[er].x=x,E[er].y=y,E[er].kind=k,E[er].life=1,E[er].blood=Eblood[k]+Day;
  }
}
void Start()
{Color(0);
    Setpos(51,0),printf("┏━━┓┏━━┓┏━━┓┏━━┓┏━━┓┏━━┓");
    Setpos(52,0),printf("┃$100┃┃$120┃┃$150┃┃$180┃┃$200┃┃$250┃");
    Setpos(53,0),printf("┃ ● ┃┃ ■ ┃┃ ▲ ┃┃ ▼ ┃┃ ◆ ┃┃ ★ ┃");Setpos(53,30),printf("Money: %d     ",money);
    Setpos(54,0),printf("┗━━┛┗━━┛┗━━┛┗━━┛┗━━┛┗━━┛");Setpos(53,40),printf("Day: %d     ",Day);
}
void Click()
{
    int What;
    pt=Windowpos();
    if(pt.x<50||pt.y>25) return;
    else What=pt.y/4+1;
    if(What==1) if(money>=100) money-=100;else return;
    if(What==2) if(money>=120) money-=120;else return;
    if(What==3) if(money>=150) money-=150;else return;
    if(What==4) if(money>=180) money-=180;else return;
    if(What==5) if(money>=200) money-=200;else return;
    if(What==6) if(money>=250) money-=250;else return;
    Color(0),Setpos(53,30),printf("Money: %d     ",money);
    mr++;M[mr].x=25;M[mr].kind=What;M[mr].blood=Mblood[What];M[mr].life=1;M[mr].CD=MCDmax[What]-1;
    while(mouse)
    { 
        mouse=GetAsyncKeyState(VK_LBUTTON)&0x8000;
        pt=Windowpos();
        M[mr].x=min(48,max(2,(int)pt.x)),M[mr].y=min(48,max(2,(int)pt.y));
        Circle(M[mr].x,M[mr].y,1,mr);
        Move(2);Map(1);Sleep(30);
        for(int i=0;i<=8;i++) N(M[mr].x+Turn[i][0],M[mr].y+Turn[i][1],-1),N(M[mr].x+Turn[i][0],M[mr].y+Turn[i][1]+0.5,-1); 
        Circle(M[mr].x,M[mr].y,-1,mr);
    }
    system("cls");memset(n,-1,sizeof(n));memset(m,-1,sizeof(m));Start();
}
void Menu()
{
    system("mode con cols=50 lines=28");Print(1);Color(0);
    Setpos(5,7);cout<<"欢迎来到  海岛奇胎  !";
    Setpos(7,12);cout<<"作者:胎神大大";
    Setpos(8,12);cout<<"原名:城市守卫战 3.0";
    Setpos(10,2);cout<<"规则:见城市守卫战,略有调整,可以自己摸索!";
    Setpos(12,5);cout<<"请选择地图:";Setpos(13,7);cout<<"1.围城  ";Setpos(14,7);cout<<"2.长城  ";Setpos(15,7);cout<<"3.王者  ";Setpos(16,7);cout<<"4.放射  ";Setpos(17,7);cout<<"5.真空(魔鬼难度)";Setpos(19,7);cout<<"输入负数则开启无尽模式";Setpos(20,9);cout<<"例:-1:无尽围城";
    endless=0;A:char a=_getch();if(a=='-') {endless=1;goto A;}else if(a<'1'||a>'5') goto A;else Level=a-'0';
    system("mode con cols=100 lines=56");Print(2);
}
int main(){
    CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);srand((unsigned)time(NULL));
    St:Menu();Start();
    memset(n,-1,sizeof(n));memset(m,-1,sizeof(m));memset(M,0,sizeof(M));memset(E,0,sizeof(E));memset(B,0,sizeof(B));
    T=ml=mr=el=er=bl=br=0;CDmax=160;Day=1;
    money=1000;if(Level==5) money=1500;
    mr++,M[mr].x=25,M[mr].y=25,M[mr].kind=0,M[mr].life=1,M[mr].blood=2000;
    if(Level==2) M[mr].y=2;
    if(Level==3) M[mr].x=48,M[mr].y=2;
if(Level==1) for(int i=0;i<=360;i+=30) mr++,M[mr].x=25+10*sin(3.1416*i/180),M[mr].y=25+10*cos(3.1416*i/180),-2,M[mr].kind=0,M[mr].life=1,M[mr].blood=500;
if(Level==2) for(int i=5;i<50;i+=6) mr++,M[mr].x=i,M[mr].y=20,M[mr].kind=0,M[mr].life=1,M[mr].blood=500,mr++,M[mr].x=i,M[mr].y=10,M[mr].kind=0,M[mr].life=1,M[mr].blood=500;
if(Level==3) for(int i=-90;i<=0;i+=45) mr++,M[mr].x=48+8*sin(3.1416*i/180),M[mr].y=2+8*cos(3.1416*i/180),-2,M[mr].kind=0,M[mr].life=1,M[mr].blood=500,mr++,M[mr].x=48+16*sin(3.1416*i/180),M[mr].y=2+16*cos(3.1416*i/180),-2,M[mr].kind=0,M[mr].life=1,M[mr].blood=500,mr++,M[mr].x=48+24*sin(3.1416*i/180),M[mr].y=2+24*cos(3.1416*i/180),-2,M[mr].kind=0,M[mr].life=1,M[mr].blood=500;
if(Level==4) for(int i=30;i<=390;i+=60) mr++,M[mr].x=25+8*sin(3.1416*i/180),M[mr].y=25+8*cos(3.1416*i/180),-2,M[mr].kind=0,M[mr].life=1,M[mr].blood=500,mr++,M[mr].x=25+15*sin(3.1416*i/180),M[mr].y=25+15*cos(3.1416*i/180),-2,M[mr].kind=0,M[mr].life=1,M[mr].blood=500;
    while(M[1].life==1)
    {
        T++;
        memset(n,-1,sizeof(n));//这里默认全输空格 
        //鼠标,键盘,暂停操作
        mouse=GetAsyncKeyState(VK_LBUTTON)&0x8000;
        pt=Windowpos();N(pt.x,pt.y,-2);
        if(mouse) Click();
        if(Day>=100&&endless==0) break;
        CD--;if(CD<=0){CD=CDmax;StartWar(Day);Day++;Setpos(53,40),printf("Day: %d     ",Day);}
            if(T%50==0) money=min(money+10,1000),Setpos(53,30),printf("Money: %d     ",money);
        Move(1);Map(1);Sleep(30);
    }
    if(Day>=100) {system("color 6E"),Sleep(1000);for(int i=1;i<=1000;i++) cout<<"YOU WIN !!  ";system("pause");system("color 0F");}
    else {system("color 7F"),Sleep(1000);for(int i=1;i<=1000;i++) cout<<"GAME OVER...  ";system("pause");system("color 0F");}
    system("cls");
    goto St;
    return 0;
}

二、红蓝大作战

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<time.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int m[20][20];
char a,b,c,d;
int xa=16,ya=4,xb=16,yb=15,fxa=20,fya=20;
int xShang,Tiao,Zuo,You,Quan,fang=1,blood=50,lan=20;
int yShang,Tiaob,Zuob,Youb,Quanb,fangb=-1,bloodb=50,lanb=20;
int Zhao,Fen,zou,zhao,Bao,baox,baoy,Di,diy,Bu;
int Lie,liey,lief,liefy,Ji,jiy,jif,Shun,r,R,s,S,M;
void Yan(int a)
{
	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);
}
void Bai(){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);}
void SetPos(int x,int y)
{
	COORD pos;
	pos.X=2*y+8;
	pos.Y=x;
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void Xue()
{
	SetPos(0,-4);for(int i=0;i<4;i++) {for(int j=0;j<38;j++)cout<<"  ";cout<<endl;}SetPos(0,-4);if(lan>30) lan=30;
	if(lanb>30) lanb=30;cout<<"    ";Yan(5);if(lan==30) Yan(3);for(int i=1;i<=lan;i++) printf("▃");Yan(1);printf("\n1p :");for(int i=2;i<=blood;i+=2) printf("█");
	if(blood%2==1) printf("▌");cout<<endl<<"    ";Yan(5);if(lanb==30) Yan(3);for(int i=1;i<=lanb;i++) printf("▃");Yan(4);printf("\n2p :");for(int i=2;i<=bloodb;i+=2) printf("█");
	if(bloodb%2==1) printf("▌");cout<<endl;SetPos(17,0);Yan(2);for(int j=0;j<20;j++) {cout<<"■";continue;} Bai();Yan(1);printf("\n\n   蓝方:A W D --控制\t\t");Yan(4);
	printf("红方:←↑→--控制\n\n"); Yan(1);printf("   J-出拳");if(lan<1) Yan(6);printf("  K-前刺");if(lan<3) Yan(6);printf("  L-分身\t");Yan(4);printf("1-出拳");
	if(lanb<1) Yan(6);printf("  2-上挑");Yan(4);if(lanb<3) Yan(6);printf("  3-瞬移\n\n");Yan(1);if(lan<3) Yan(6);printf("   U-回血");Yan(1);if(lan<5) Yan(6);printf("  I-裂地");Yan(1);
	if(lan<10) Yan(6);printf("  O-炸地\t");Yan(4);if(lanb<3) Yan(6);printf("4-回血");Yan(4);if(lanb<5) Yan(6);printf("  5-震爆");Yan(4);if(lanb<7) Yan(6);printf("  6-激光");Bai();
}
void Wo(){Yan(1),SetPos(xa,ya),cout<<"●";Yan(4),SetPos(xb,yb),cout<<"●";if(Fen!=0) Bai(),SetPos(fxa,fya),cout<<"●";}
void Hong(){Wo();system("color 4F"),Sleep(10),system("color 0F"),Xue();}
void Lan(){Wo();system("color 1F"),Sleep(10),system("color 0F"),Xue();}
void Lv(){Wo();system("color 2F"),Sleep(10),system("color 0F"),Xue();} 
void Zou()
{
	zou=0;
	SetPos(xa,ya),cout<<"  ";SetPos(xb,yb),cout<<"  ";
	if(Fen>0) SetPos(fxa,fya),cout<<"  ";SetPos(0,-4);
	if(fxa<=5||xa<=5) xShang=0;
	if(xa==xb&&ya==yb) xa--,zou=1;
	if(fxa==xa&&fya==ya) fxa--,zou=1;
	if(fxa==xb&&fya==yb) fxa--,zou=1;
	if(Fen>0)
	{
		if(xa==fxa+1&&ya==fya&&fang==-1){if(fya>0) fya--;else fya+=2;}
		if(xa==fxa+1&&ya==fya&&fang==1){if(fya<19) fya++;else fya-=2;}
		if(fxa+1==xb&&fya==yb&&fang==-1){if(fya>0) fya--;else fya+=2;}
		if(fxa+1==xb&&fya==yb&&fang==1){if(fya<19) fya++;else fya-=2;}
		if(Tiao>0)
		{
			if(fang==-1&&fya>0&&(fxa!=xb||fya-1!=yb)&&(fxa!=xa||fya-1!=ya)) fya--;
			if(fang==1&&fya<19&&(fxa!=xb||fya+1!=yb)&&(fxa!=xa||fya+1!=ya)) fya++;
		}
		if(xShang>0) m[fxa][fya]=0,fxa-=2;
		if(fxa<16) m[fxa][fya]=0,fxa++;
	}
	if(xa+1==xb&&ya==yb&&fang==-1){if(ya>0) ya--;else ya+=2;}
	if(xa+1==xb&&ya==yb&&fang==1){if(ya<19) ya++;else ya-=2;}
	if(xa+1==fxa&&ya==fya&&fang==-1){if(ya>0) ya--;else ya+=2;}
	if(xa+1==fxa&&ya==fya&&fang==1){if(ya<19) ya++;else ya-=2;}
	if(Zuo>0&&ya>0&&Tiao==0&&(xa!=xb||ya-1!=yb)&&(fxa!=xa||fya!=ya-1)) m[xa][ya]=0,ya--;
	if(Zuo>0&&fya>0&&Tiao==0&&(fxa!=xb||fya-1!=yb)&&(xa!=fxa||ya!=fya-1)) m[fxa][fya]=0,fya--;Zuo=0;
	if(You>0&&ya<19&&Tiao==0&&(xa!=xb||ya+1!=yb)&&(fxa!=xa||fya!=ya+1)) m[xa][ya]=0,ya++;
	if(You>0&&fya<19&&Tiao==0&&(fxa!=xb||fya+1!=yb)&&(xa!=fxa||ya!=fya+1)) m[fxa][fya]=0,fya++;You=0;
	if(Tiao>0)
	{
		if(fang==-1&&ya>0&&(xa!=xb||ya-1!=yb)&&(fxa!=xa||fya!=ya-1)) ya--;
		if(fang==1&&ya<19&&(xa!=xb||ya+1!=yb)&&(fxa!=xa||fya!=ya+1)) ya++;
	}
	if(xShang>0) m[xa][ya]=0,xShang--,xa-=2;
	if(xa<16) m[xa][ya]=0,xa++;
	if(xa==16) Tiao=0;
	if(xb<=5) yShang=0;
	if(xa==xb+1&&ya==yb&&fangb==-1){if(yb>0) yb--;else yb+=2;}
	if(xa==xb+1&&ya==yb&&fangb==1){if(yb<19) yb++;else yb-=2;}
	if(xb+1==fxa&&yb==fya&&fangb==-1){if(yb>0) yb--;else yb+=2;}
	if(xb+1==fxa&&yb==fya&&fangb==1){if(yb<19) yb++;else yb-=2;}
	if(Zuob>0&&yb>0&&Tiaob==0&&(xa!=xb||ya!=yb-1)&&(fxa!=xb||fya!=yb-1)) m[xb][yb]=0,Zuob=0,yb--;Zuob=0;
	if(Youb>0&&yb<19&&Tiaob==0&&(xa!=xb||ya!=yb+1)&&(fxa!=xb||fya!=yb+1)) m[xb][yb]=0,Youb=0,yb++;Youb=0;
	if(Tiaob>0&&Bu==0)
	{
		if(fangb==-1&&yb>0&&(xa!=xb||ya!=yb-1)&&(fxa!=xb||fya!=yb-1)) yb--;
		if(fangb==1&&yb<19&&(xa!=xb||ya!=yb+1)&&(fxa!=xb||fya!=yb+1)) yb++;
	}
	if(yShang>0) m[xb][yb]=0,yShang--,xb-=2;
	if(xb<16) m[xb][yb]=0,xb++;
	if(xb==16) Tiaob=0;
	SetPos(0,-4);if(zou==1) Zou();
	Sleep(10);
}
void Xian()
{
	zhao=0;s++;
	if(M>=5) {Zhao=0;return;}
	if(s==70) {s=0;if(lan<40)lan++;if(lanb<40)lanb++;Xue();}
	SetPos(0,-4);
	if(Bao!=0)
	{
		Bao--;Zhao--;
		for(int i=baox-3;i<=baox+3;i++)
		for(int j=baoy-3;j<=baoy+3;j++) if(i<=16&&j>=0&&j<=19) m[i][j]=9;
		for(int i=baox-1;i<=baox+1;i++)
		for(int j=baoy-1;j<=baoy+1;j++) if(i<=16&&j>=0&&j<=19) m[i][j]=0;
	}if(Bao==0) baox=0,baoy=0;
	if(Lie!=0)
	{
		Lie--;Zhao--;
		if(lief==-1) for(int i=1;i<=7-Lie;i++) if(liey+Lie>=0) m[18-i][liey+Lie]=11;
		if(lief==1) for(int i=1;i<=7-Lie;i++) if(liey-Lie<=19) m[18-i][liey-Lie]=10;
		if(Fen>0)
		{
			if(lief==-1) for(int i=1;i<=7-Lie;i++) if(liefy+Lie>=0) m[18-i][liefy+Lie]=11;
			if(lief==1) for(int i=1;i<=7-Lie;i++) if(liefy-Lie<=19) m[18-i][liefy-Lie]=10;
		}
	}if(Lie==0) liey=0,lief=0,liefy=0;
	if(Ji!=0)
	{
		Ji--;Zhao--;
		if(jif==-1) for(int i=jiy;i>=0;i--) m[xb][i]=14;
		if(jif==1) for(int i=jiy;i<=19;i++) m[xb][i]=13;
	}if(Ji==0) jiy=0,jif=0;
	if(Di!=0)
	{
		Di--;Zhao--;
		for(int i=2;i<=16;i++) m[i][diy]=19;
		if(Fen>0&&yb!=0&&yb!=19) for(int i=2;i<=16;i++) m[i][diy+fangb]=19;
	}if(Di==0) diy=0;
	if(Shun!=0)
	{
		SetPos(Shun,-4);cout<<"                                                     ";
		Shun=0;
	}
	Bu=0;
	if(m[xa][ya]==3) {Shun=xa,Zuo+=1,xShang+=4,blood-=1,Zhao=0,m[xa][ya]=7,Lan(),lan++,zhao=1;Xue();}
	else if(m[xa][ya]==4) {Shun=xa,You+=1,xShang+=4,blood-=1,Zhao=0,m[xa][ya]=7,Lan(),lan++,zhao=1;Xue();}
	else if(m[xa][ya]==9) {Shun=xa,xShang=7,blood-=2,Zhao=0,m[xa][ya]=7,Lan(),lan+=2,zhao=1;Xue();}
	else if(m[xa][ya]==13) {Shun=xa,You+=1,blood-=2,Zhao=0,m[xa][ya]=7,Lan(),lan+=2,zhao=1;Xue();}
	else if(m[xa][ya]==14) {Shun=xa,Zuo+=1,blood-=2,Zhao=0,m[xa][ya]=7,Lan(),lan+=2,zhao=1;Xue();}
	else if(m[xa][ya]==15) {Shun=xa,You+=1,blood-=1,Zhao=0,m[xa][ya]=7,Lan(),lan+=1,zhao=1;Xue();}
	else if(m[xa][ya]==16) {Shun=xa,Zuo+=1,blood-=1,Zhao=0,m[xa][ya]=7,Lan(),lan+=1,zhao=1;Xue();}
	else m[xa][ya]=1;
	if(m[fxa][fya]==3||m[fxa][fya]==4||m[fxa][fya]==9||m[fxa][fya]==13||m[fxa][fya]==14||m[fxa][fya]==15||m[fxa][fya]==16)
	{Zhao=0,m[fxa][fya]=7,fxa=20,fya=20,Fen=0,Lan(),zhao=1;Xue();}
	if(m[xb][yb]==5) {Shun=xb,Zuob+=4,yShang+=1,bloodb-=1,Zhao=0,m[xb][yb]=7,Hong(),lanb++,zhao=1;Xue();}
	else if(m[xb][yb]==6) {Shun=xb,Youb+=4,yShang+=1,bloodb-=1,Zhao=0,m[xb][yb]=7,Hong(),lanb++,zhao=1;Xue();}
	else if(m[xb][yb]==10) {Shun=xb,Youb+=1,yShang+=1,bloodb-=2,Zhao=0,m[xb][yb]=7,Hong(),lanb+=2,zhao=1;Xue();}
	else if(m[xb][yb]==11) {Shun=xb,Zuob+=1,yShang+=1,bloodb-=2,Zhao=0,m[xb][yb]=7,Hong(),lanb+=2,zhao=1;Xue();}
	else if(m[xb][yb]==17) {Shun=xb,Youb+=1,bloodb-=1,Zhao=0,m[xb][yb]=7,Hong(),lanb+=1,zhao=1;Xue();}
	else if(m[xb][yb]==18) {Shun=xb,Zuob+=1,bloodb-=1,Zhao=0,m[xb][yb]=7,Hong(),lanb+=1,zhao=1;Xue();}
	else if(m[xb][yb]==19) {Shun=xb,Bu=1,yShang+=3,bloodb-=1,Zhao=0,m[xb][yb]=7,Hong(),lanb+=1,zhao=1;Xue();}
	else m[xb][yb]=2;
	if(Fen>0) m[fxa][fya]=8;
	for(int i=5;i<=16;i++)
	for(int j=0;j<20;j++)
	{
		if(m[i][j]==20) {SetPos(i,j);cout<<"  ",m[i][j]=0;continue;}
		if(m[i][j]==1) {Yan(1),SetPos(i,j);cout<<"●",m[i][j]=20,Bai();continue;}
		if(m[i][j]==2) {Yan(4),SetPos(i,j);cout<<"●",m[i][j]=20,Bai();continue;}
		if(m[i][j]==8) {Bai(),SetPos(i,j);cout<<"●",m[i][j]=20;continue;}
		if(m[i][j]==7) {Yan(5),SetPos(i,j);cout<<"█",m[i][j]=20,zhao=1;Bai();continue;}
		if(m[i][j]==12) {Bai(),SetPos(i,j);cout<<"●",Shun=xb;continue;}
		if(m[i][j]>=3&&m[i][j]<=6||(m[i][j]>=9&&m[i][j]<=11)||(m[i][j]>=13))
		{Bai(),SetPos(i,j);cout<<"■";m[i][j]=20,Zhao=0,zhao=1;continue;}
	}
	if(zhao>0) {M++,Zou(),Xian();M=0;return;}
	memset(m,0,sizeof(m));M=0;
}
void Go(char a)
{
	if(a=='j') Quan++; else Quan=0;
	if(a=='w'&&Tiao==0) Tiao++,xShang+=3;
	if(a=='a'&&Tiao==0) Zuo=1,You=0,fang=-1;
	if(a=='d'&&Tiao==0) You=1,Zuo=0,fang=1;
	if(a=='j'&&Quan<=3&&fang==-1&&ya-1>=0) {m[xa][ya-1]=18;if(Fen>0&&fya-1>=0) m[fxa][fya-1]=18;}
	if(a=='j'&&Quan<=3&&fang==1&&ya+1<=19) {m[xa][ya+1]=17;if(Fen>0&&fya+1<=19) m[fxa][fya+1]=17;}
	if(a=='k'&&fang==-1&&lan>=1&&ya!=0) {lan--,Xue();Zhao++;for(int i=1;i<=3;i++){if(ya-i>=0) m[xa][ya-i]=5;if(Fen>0&&fya-i>=0) m[fxa][fya-i]=5;}}
	if(a=='k'&&fang==1&&lan>=1&&ya!=19) {lan--,Xue();Zhao++;for(int i=1;i<=3;i++){if(ya+i<=19) m[xa][ya+i]=6;if(Fen>0&&fya+i<=19) m[fxa][fya+i]=6;}}
	if(a=='l'&&Fen==0&&lan>=3) lan-=3,Xue(),Lan(),fxa=xa-3,fya=rand()%19,Fen=1,Zou(),Xian();
	if(a=='u'&&lan>=3) lan-=3,Xue(),Lv(),blood+=2;
	if(a=='i'&&lan>=5) lan-=5,Xue(),Zhao+=3,Di+=3,diy=yb;
	if(a=='o'&&fang==-1&&lan>=10) {lan-=10,Xue();Zhao+=6,Lie=6,liey=ya-6,lief=-1,liefy=0;if(Fen>0) liefy=fya-6;}
	if(a=='o'&&fang==1&&lan>=10) {lan-=10,Xue();Zhao+=6,Lie=6,liey=ya+6,lief=1,liefy=0;if(Fen>0) liefy=fya+6;}
	
	if(a=='1') Quanb++; else Quanb=0;
	if(a==72&&Tiaob==0) Tiaob++,yShang+=3;
	if(a==75&&Tiaob==0) Zuob=1,Youb=0,fangb=-1;
	if(a==77&&Tiaob==0) Youb=1,Zuob=0,fangb=1;
	if(a=='1'&&Quanb<=3&&fangb==-1&&yb-1>=0) m[xb][yb-1]=16;
	if(a=='1'&&Quanb<=3&&fangb==1&&yb+1<=19) m[xb][yb+1]=15;
	if(a=='2'&&fangb==-1&&lanb>=1&&yb!=0) {lanb--,Xue();Zhao++;for(int i=1;i<=3;i++){if(yb-i>=0) m[xb][yb-i]=3;}}
	if(a=='2'&&fangb==1&&lanb>=1&&yb!=19) {lanb--,Xue();Zhao++;for(int i=1;i<=3;i++){if(yb+i<=19) m[xb][yb+i]=4;}}
	if(a=='3'&&fangb==1&&lanb>=3&&yb!=19) {lanb-=3;Xue();for(int i=yb;i<=18;i++) m[xb][i]=12;yb=19;Xian();}
	if(a=='3'&&fangb==-1&&lanb>=3&&yb!=0) {lanb-=3;Xue();for(int i=yb;i>0;i--) m[xb][i]=12;yb=0;Xian();}
	if(a=='4'&&lanb>=3) lanb-=3,Xue(),Lv(),bloodb+=2;
	if(a=='5'&&lanb>=5) lanb-=5,Xue(),Zhao+=3,Bao+=3,baox=xb,baoy=yb;
	if(a=='6'&&lanb>=7) lanb-=7,Xue(),Zhao+=3,Ji+=3,jiy=yb,jif=fangb;
}
int main()
{
	x:
	system("cls");
	srand((unsigned)time(NULL));Bai();
	cout<<endl<<" -------------------胎红 VS 胎蓝---------------------"<<endl;
	cout<<" ---------------------------作者:胎神---------------"<<endl<<endl;Yan(5);
	cout<<"       2.0版本,憾世来袭!"<<endl<<endl;
	cout<<"       2大更新:"<<endl<<endl;
	cout<<"          1.完美解决“闪”的问题!"<<endl<<endl;
	cout<<"          2.单人模式来了!完全电脑AI控制,比双人模式更难!"<<endl<<endl;
	cout<<"          3.技能平衡性调整,更合理化的对战体验。"<<endl<<endl;Yan(1);
	cout<<" 已开启  闪光功能:当蓝方挨血时,画面闪蓝光,反之闪红光;恢血时闪绿光。"<<endl<<endl;Bai();
	cout<<" 请输入: 1.单人模式   2.双人模式"<<endl<<endl;A:a=_getch();
	if(a=='1')
	{
		cout<<" 你要当谁?   1.小胎蓝   2.小胎红   3.老子不想打了,让他们自己打!"<<endl<<endl;b=_getch();
		cout<<" 选择难度:   1.简单的像吃屎   2.一般的像垃圾   3.巨难的像变胎"<<endl<<endl;
		cout<<"          (难度越简单,对方动作越迟缓。)"<<endl<<endl;d=_getch();
		if(d=='1') R=5;
		if(d=='2') R=3;
		if(d=='3') R=1;
		system("cls");
		Xue();Xian();
		while(blood>0&&bloodb>0)
		{
			SetPos(0,-4);M=0;
			Zou();Xian();
			if(b=='1'||b=='3')
			{
				S++;
				if(S>=R)
				{
					S=0;c=0;int xxa=xa,yya=ya;
					if(lanb>=7) r=rand()%6;else if(lanb>=5) r=rand()%7-2;else if(lanb>=3) r=rand()%6-2;else if(lanb>=1) r=rand()%4-1;else r=rand()%3-1;
					if(Fen>0) xxa=fxa,yya=fya;
					if((xb==16&&yb==0)||(xb==16&&yb==19)) r=0;
					if(r==5){if(fangb==-1&&xxa==xb&&yya<=yb) c='6';if(fangb==1&&xxa==xb&&yya>=yb) c='6';else r=0;}
					if(r==4){if(xxa==xb&&abs(yya-yb)<=1) r=0;if(fangb==-1&&yb-3<=yya&&yya<=yb-1) c='5';if(fangb==1&&yb+3>=yya&&yya>=yb+1) c='5';else r=0;}
					if(r==3&&bloodb<30&&lan>=3) c='4';
					if(r==2){if(fangb==-1&&yb-3<=yya&&yya<=yb) c='2';if(fangb==1&&yb+3>=yya&&yya>=yb) c='2';else r=0;}
					if(r==1){if(fangb==-1&&yb-1==yya) c='1';else if(fangb==1&&yb+1==yya) c='1';else r=0;}
					if(yya<=yb&&r==0){int rr=rand()%5;if(fangb==-1&&rr==0) c=72;else if(fangb==-1&&rr==1&&abs(yya-yb)>=5) c='3';else c=75;}
					if(yya>yb&&r==0){int rr=rand()%5;if(fangb==1&&rr==0) c=72;else if(fangb==1&&rr==1&&abs(yya-yb)>=5) c='3';else c=77;}
					if(c!=0) Go(c);
				}
			}
			if(b=='2'||b=='3')
			{
				S++;
				if(S>=R)
				{
					S=0;c=0;
					if(lanb>=10) r=rand()%10;else if(lanb>=5) r=rand()%9-3;else if(lanb>=3) r=rand()%8-3;else if(lanb>=1) r=rand()%6-2;else r=rand()%3-1;
					if((xa==16&&ya==0)||(xa==16&&ya==19)) r=0;
					if(r>=6){if(fang==-1&&ya>=yb&&abs(ya-yb)<=2) c='o';if(fang==1&&ya<=yb&&abs(ya-yb)<=2) c='o';else r=0;}
					if(r==5) c='i';
					if(r==4&&blood<30&&lan>=3) c='u';
					if(r==3&&Fen==0) c='l';
					if(r==2){if(fang==1&&yb-3<=ya&&ya<=yb) c='k';if(fang==-1&&yb+3>=ya&&ya>=yb) c='k';else r=0;}
					if(r==1){if(fang==1&&yb-1==ya) c='j';else if(fang==-1&&yb+1==ya) c='j';else r=0;}
					if(ya>=yb&&r==0){int rr=rand()%5;if(fang==-1&&rr==0) c='w';else c='a';}
					if(ya<yb&&r==0){int rr=rand()%5;if(fang==1&&rr==0) c='w';else c='d';}
					if(c!=0) Go(c);
				}
			}
			if(kbhit())
			{
				SetPos(0,-4);
				if(b=='1')
				{
					if(KEY_DOWN(87)) Go('w');if(KEY_DOWN(65)) Go('a');if(KEY_DOWN(68)) Go('d');
					if(KEY_DOWN(74)) Go('j');if(KEY_DOWN(75)) Go('k');if(KEY_DOWN(76)) Go('l');
					if(KEY_DOWN(85)) Go('u');if(KEY_DOWN(73)) Go('i');if(KEY_DOWN(79)) Go('o');
				}
				if(b=='2')
				{
					if(KEY_DOWN(38)) Go(72);if(KEY_DOWN(37)) Go(75);if(KEY_DOWN(39)) Go(77);
					if(KEY_DOWN(97)) Go('1');if(KEY_DOWN(98)) Go('2');if(KEY_DOWN(99)) Go('3');
					if(KEY_DOWN(100)) Go('4');if(KEY_DOWN(101)) Go('5');if(KEY_DOWN(102)) Go('6');
				}
				Zou(),Xian();
			}
			if(Zhao>0) Zou(),Xian();
			Sleep(20);
		}
	}
	else if(a=='2')
	{
		system("cls");
		Xue();Xian();
		while(blood>0&&bloodb>0)
		{
			SetPos(0,-4);
			if(!kbhit()) Zou(),Xian();
			if(kbhit())
			{
				SetPos(0,-4);
				if(KEY_DOWN(87)) Go('w');if(KEY_DOWN(65)) Go('a');if(KEY_DOWN(68)) Go('d');
				if(KEY_DOWN(74)) Go('j');if(KEY_DOWN(75)) Go('k');if(KEY_DOWN(76)) Go('l');
				if(KEY_DOWN(85)) Go('u');if(KEY_DOWN(73)) Go('i');if(KEY_DOWN(79)) Go('o');
				if(KEY_DOWN(38)) Go(72);if(KEY_DOWN(37)) Go(75);if(KEY_DOWN(39)) Go(77);
				if(KEY_DOWN(97)) Go('1');if(KEY_DOWN(98)) Go('2');if(KEY_DOWN(99)) Go('3');
				if(KEY_DOWN(100)) Go('4');if(KEY_DOWN(101)) Go('5');if(KEY_DOWN(102)) Go('6');
				Zou(),Xian();
			}
			if(Zhao>0) Zou(),Xian();Sleep(20);
		}
	}
	else goto A;
	system("cls");
	if(blood>0) Yan(1);
	if(bloodb>0) Yan(4);
	cout<<endl<<endl<<endl;
	cout<<"        ┌-------------┐"<<endl; 
	cout<<"        ┆             ┆"<<endl;
	if(blood>0) cout<<"        ┆   1p WIN!!! ┆"<<endl;
	if(bloodb>0) cout<<"        ┆   2p WIN!!! ┆"<<endl;
	cout<<"        ┆             ┆"<<endl;
	cout<<"        └-------------┘"<<endl<<endl;
	Sleep(2000);Bai();system("cls");
	xa=16,ya=4,xb=16,yb=15,fxa=20,fya=20;
	xShang=Tiao=Zuo=You,Quan=0,fang=1,blood=50,lan=20;
	yShang=Tiaob=Zuob=Youb=Quanb=0,fangb=-1,bloodb=50,lanb=20;
	Zhao=Fen=zou=zhao=Bao=baox=baoy=Di=diy=Bu=0;
	Lie=liey=lief=liefy=Ji=jiy=jif=Shun=r=R=s=S=M=0;goto x;
	return 0;
}

三、幻门疾走 

#include<bits/stdc++.h> 
#include<conio.h>
#include<windows.h>
using namespace std;
void Color(int a){
    if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
    if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),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==-5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN);
}
struct node{int x,y,w,turn,kind;bool life;}B[1001];
void Setpos(int x,int y){COORD pos;pos.X=y*2,pos.Y=x;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}
int bl,boom,dooring,T,win,x,y,speed=300,spnum=0,Score,Bspeed=5,Mapsize=18;
int M[35][35],M2[35][35];
int dx[5]={0,-1,0,1,0},dy[5]={0,0,1,0,-1};// 上右下左 
void Delete(int x,int y)
{
	if(x<=0||x>=Mapsize||y<=0||y>=Mapsize) return;
	M[x][y]=0;M2[x][y]=0;
    for(int i=1;i<=bl;i++) if(B[i].x==x&&B[i].y==y) B[i].life=0;
	Setpos(x,y);cout<<"  ";
}
void Move(int i){
    int x0=B[i].x,y0=B[i].y,t=B[i].turn,j=0,r=2*(rand()%2)-1;
    while(j<4){
	if(M[x0+dx[t]][y0+dy[t]]==0){
	B[i].x=x0+dx[t];
	B[i].y=y0+dy[t];
	B[i].turn=t;break;}
	else if(B[i].w==2&&M2[x0+dx[t]][y0+dy[t]]==1){
		Delete(x0+dx[t],y0+dy[t]);
	B[i].x=x0+dx[t];
	B[i].y=y0+dy[t];
	B[i].turn=t;break;}
    	j++;
    	if(j==1) t+=r;if(j==2) t-=2*r;if(j==3) t--;
    	if(t>4) t-=4;if(t<1) t+=4;
	}
	return;
}
void Cout(int i,int j,int a,int x)
{
    int c=5;
    if(x==0) a=M[i][j];
    if(x==404) c=4;
    if(a==0&&i%2==0&&j%2==0) return;
    if(i<0||j<0||i>Mapsize||j>Mapsize) return;
    Setpos(i,j);
    if(i==x&&j==y) Color(1),cout<<"●";
    else if(x!=0&&a==0) Color(0),cout<<"  ";
    else if(a==1) Color(c),cout<<"↑";
    else if(a==2) Color(c),cout<<"→";
    else if(a==3) Color(c),cout<<"↓";
    else if(a==4) Color(c),cout<<"←"; 
    else if(a==5) Color(7),cout<<"■";
    else if(a==6) Color(3),cout<<"★";
    else if(a==7) Color(2),cout<<"◆";
}
void Map(int a){
    for(int i=1-a;i<=Mapsize-1+a;i++)
    for(int j=1-a;j<=Mapsize-1+a;j++){Cout(i,j,a,0);}
    Setpos(32,3);Color(1),cout<<"Score: "<<Score;
	Setpos(32,10);Color(3),cout<<"  ["<<boom<<" ★]  Z    ",Color(2),cout<<"["<<dooring<<" ◆]  X";
}
void CreatMap(int a){
    bool ii,jj;int R,kR;
        bl=0;
    for(int i=0;i<=Mapsize;i++)
    for(int j=0;j<=Mapsize;j++){
    ii=i%2;jj=j%2,R=rand()%50,kR=rand()%30;
    if((ii==0&&jj==0)||i==0||j==0||i==Mapsize||j==Mapsize) M[i][j]=5;
    else if(ii==1&&jj==0&&R<=31){
        if(i==1) M[i][j]=1;
        else if(R<=5) M[i][j]=5;
        else if(i==Mapsize-1) M[i][j]=3;
        else M[i][j]=1+(rand()%2)*2;
    }
    else if(ii==0&&jj==1&&R<=31){
        if(j==1) M[i][j]=4;
        else if(R<=5) M[i][j]=5;
        else if(j==Mapsize-1) M[i][j]=2;
        else M[i][j]=2+(rand()%2)*2;}
    else if(ii==1&&jj==1){
    if(R>=37) M[i][j]=5;
    if(bl<=20&&kR==0) bl++;B[bl].life=1,B[bl].w=7,B[bl].x=i,B[bl].y=j,B[bl].turn=rand()%4+1;
    }}
    if(a==2){for(int i=7;i<=23;i++)for(int j=7;j<=23;j++) M[i][j]=0;} 
}
int door(int x0,int y0,int ax,int ay,int m,int t){
    int nextplace,npx,npy;
    if(ax==2&&m==2&&t==1) return M[x0+1][y0];
    if(ax==2&&m==4&&t==1) return M[x0+1][y0];
    if(ax==2&&m==2&&t==2) return M[x0+1][y0-1];
    if(ax==2&&m==4&&t==2) return M[x0+1][y0+1];
    if(ax==-2&&m==2&&t==1) return M[x0-1][y0];
    if(ax==-2&&m==4&&t==1) return M[x0-1][y0];
    if(ax==-2&&m==2&&t==2) return M[x0-1][y0-1];
    if(ax==-2&&m==4&&t==2) return M[x0-1][y0+1];
    if(ay==2&&m==1&&t==1) return M[x0][y0+1];
    if(ay==2&&m==3&&t==1) return M[x0][y0+1];
    if(ay==2&&m==1&&t==2) return M[x0+1][y0+1];
    if(ay==2&&m==3&&t==2) return M[x0-1][y0+1];
    if(ay==-2&&m==1&&t==1) return M[x0][y0-1];
    if(ay==-2&&m==3&&t==1) return M[x0][y0-1];
    if(ay==-2&&m==1&&t==2) return M[x0+1][y0-1];
    if(ay==-2&&m==3&&t==2) return M[x0-1][y0-1];
}
bool DoorCango(int x0,int y0,int ax,int ay,int m)
{
    if(M2[x][y]==5) return 0;
    return 1;
}
void PushDoor(int x0,int y0,int ax,int ay,int time,int px,int py,int pre){
    bool go=0;
    if(time==0) Setpos(x0,y0),Color(1),cout<<"●";
    else if(time==1) Setpos(px,py),cout<<"  ",Setpos(x,y),Color(1),cout<<"●";
    if(time>=1) Setpos(x0,y0),Color(-5),cout<<"po",Color(0),Sleep(speed),spnum++,Setpos(x0,y0),Cout(x0,y0,pre,1);
    int MM=M[x0][y0];M[x0][y0]=pre;
    if(ax==2){
        if(MM==2){
            Setpos(x0+1,y0),Color(5),cout<<"↘",Sleep(speed),spnum++;
                if(time==0) Setpos(x0+1,y0),Color(1),cout<<"●";
            Setpos(x0+1,y0),cout<<"  ",Setpos(x0+1,y0-1),Color(5),cout<<"↓",M[x0][y0]=0;
            if(M[x0+1][y0-1]>=1&&M[x0+1][y0-1]<=4) PushDoor(x0+1,y0-1,0,-2,time+1,x0,y0,3),go=1;
            M[x0+1][y0-1]=3;
        }
        if(MM==4){
            Setpos(x0+1,y0),Color(5),cout<<"↙",Sleep(speed),spnum++;
                if(time==0) Setpos(x0+1,y0),Color(1),cout<<"●";
            Setpos(x0+1,y0),cout<<"  ",Setpos(x0+1,y0+1),Color(5),cout<<"↓",M[x0][y0]=0;
            if(M[x0+1][y0+1]>=1&&M[x0+1][y0+1]<=4) PushDoor(x0+1,y0+1,0,2,time+1,x0,y0,3),go=1;
            M[x0+1][y0+1]=3;
        }
    }
    if(ax==-2){
        if(MM==2){
            Setpos(x0-1,y0),Color(5),cout<<"↗",Sleep(speed),spnum++;
                if(time==0) Setpos(x0-1,y0),Color(1),cout<<"●";
            Setpos(x0-1,y0),cout<<"  ",Setpos(x0-1,y0-1),Color(5),cout<<"↑",M[x0][y0]=0;
            if(M[x0-1][y0-1]>=1&&M[x0-1][y0-1]<=4) PushDoor(x0-1,y0-1,0,-2,time+1,x0,y0,1),go=1;
            M[x0-1][y0-1]=1;
        }
        if(MM==4){
            Setpos(x0-1,y0),Color(5),cout<<"↖",Sleep(speed),spnum++;
                if(time==0) Setpos(x0-1,y0),Color(1),cout<<"●";
            Setpos(x0-1,y0),cout<<"  ",Setpos(x0-1,y0+1),Color(5),cout<<"↑",M[x0][y0]=0;
            if(M[x0-1][y0+1]>=1&&M[x0-1][y0+1]<=4) PushDoor(x0-1,y0+1,0,2,time+1,x0,y0,1),go=1;
            M[x0-1][y0+1]=1;
        }
    }
    if(ay==2){
        if(MM==1){
            Setpos(x0,y0+1),Color(5),cout<<"↗",Sleep(speed),spnum++;
                if(time==0) Setpos(x0,y0+1),Color(1),cout<<"●";
            Setpos(x0,y0+1),cout<<"  ",Setpos(x0+1,y0+1),Color(5),cout<<"→",M[x0][y0]=0;
            if(M[x0+1][y0+1]>=1&&M[x0+1][y0+1]<=4) PushDoor(x0+1,y0+1,2,0,time+1,x0,y0,2),go=1;
            M[x0+1][y0+1]=2;
        }
        if(MM==3){
            Setpos(x0,y0+1),Color(5),cout<<"↘",Sleep(speed),spnum++;
                if(time==0) Setpos(x0,y0+1),Color(1),cout<<"●";
            Setpos(x0,y0+1),cout<<"  ",Setpos(x0-1,y0+1),Color(5),cout<<"→",M[x0][y0]=0;
            if(M[x0-1][y0+1]>=1&&M[x0-1][y0+1]<=4) PushDoor(x0-1,y0+1,-2,0,time+1,x0,y0,2),go=1;
            M[x0-1][y0+1]=2;
        }
    }
    if(ay==-2){
        if(MM==1){
            Setpos(x0,y0-1),Color(5),cout<<"↖",Sleep(speed),spnum++;
                if(time==0) Setpos(x0,y0-1),Color(1),cout<<"●";
            Setpos(x0,y0-1),cout<<"  ",Setpos(x0+1,y0-1),Color(5),cout<<"←",M[x0][y0]=0;
            if(M[x0+1][y0-1]>=1&&M[x0+1][y0-1]<=4) PushDoor(x0+1,y0-1,2,0,time+1,x0,y0,4),go=1;
            M[x0+1][y0-1]=4;
        }
        if(MM==3){
            Setpos(x0,y0-1),Color(5),cout<<"↙",Sleep(speed),spnum++;
                if(time==0) Setpos(x0,y0-1),Color(1),cout<<"●";
            Setpos(x0,y0-1),cout<<"  ",Setpos(x0-1,y0-1),Color(5),cout<<"←",M[x0][y0]=0;
            if(M[x0-1][y0-1]>=1&&M[x0-1][y0-1]<=4) PushDoor(x0-1,y0-1,-2,0,time+1,x0,y0,4),go=1;
            M[x0-1][y0-1]=4;
        }
    }
    if(time==0) Setpos(x0,y0),cout<<"  ",Setpos(x,y),Color(1),cout<<"●";
    if(go==0) Map(0);
}
void OpenDoor(int x0,int y0,int x2,int y2){
    int xx=(x0+x2)/2,yy=(y0+y2)/2;
    if(M[xx][yy]==5||M[x2][y2]==5) return;
    else if(M[xx][yy]==6) {x=x2;y=y2;boom++;M[xx][yy]=0;return;}
    else if(M[xx][yy]==7) {x=x2;y=y2;dooring++;M[xx][yy]=0;return;}
    else if(M[xx][yy]==0) {x=x2;y=y2;return;}
    else if(M[xx][yy]>=1&&M[xx][yy]<=4) {
    x=x2,y=y2;PushDoor(xx,yy,x2-x0,y2-y0,0,0,0,0);
    }
}
int yx(){
    str:system("cls");
    Setpos(10,10);cout<<"请选择地图大小(1~6):";int a;cin>>a;if(a>=1&&a<=6) Mapsize=4*a+6;else goto str;
    str2:system("cls");Setpos(12,10);cout<<"请调整小怪速度(1最慢,9最快):";cin>>a;if(a>=1&&a<=9) Bspeed=pow(2,9-a);else goto str2;
    system("cls");x=y=1;
    CreatMap(1);
	boom=3;dooring=3;Score=0; 
    Map(1);
while(Score<20)
{
    T++;
        Setpos(x,y),cout<<"  ";
        if(GetAsyncKeyState(VK_UP)&0x8000) OpenDoor(x,y,x-2,y);
        else if(GetAsyncKeyState(VK_DOWN)&0x8000) OpenDoor(x,y,x+2,y);
        else if(GetAsyncKeyState(VK_LEFT)&0x8000) OpenDoor(x,y,x,y-2);
        else if(GetAsyncKeyState(VK_RIGHT)&0x8000) OpenDoor(x,y,x,y+2);
        if(kbhit())
        {
            char g=_getch();int fx,fy;
            if(g=='z'&&boom>0) {boom--;for(int k=1;k<=4;k++) Setpos(x+dx[k],y+dy[k]),Color(5),cout<<"■",Sleep(100),Delete(x+dx[k],y+dy[k]);Delete(x,y);
								for(int k=1;k<=4;k++) Setpos(x+2*dx[k],y+2*dy[k]),Color(5),cout<<"■",Sleep(100),Delete(x+2*dx[k],y+2*dy[k]);}
            if(g=='x'&&dooring>0) {dooring--;for(int k=1;k<=4;k++) {Setpos(x+dx[k],y+dy[k]),Color(5),cout<<"■",Sleep(100),cout<<"  ",fx=x+dx[k],fy=y+dy[k];
            	if(fx<=0||fx>=Mapsize||fy<=0||fy>=Mapsize) continue;
					 if(fx%2==1&&fy%2==0){if(fx==1) M[fx][fy]=1;else if(fx==Mapsize-1) M[fx][fy]=3;else M[fx][fy]=1+(rand()%2)*2;}
				else if(fx%2==0&&fy%2==1){if(fy==1) M[fx][fy]=4;else if(fy==Mapsize-1) M[fx][fy]=2;else M[fx][fy]=2+(rand()%2)*2;}}Map(1);}
        }
        Setpos(x,y),Color(1),cout<<"●";

   if(M[x][y]==6) boom++,M[x][y]=0,Map(1);
   if(M[x][y]==7) dooring++,M[x][y]=0,Map(1);
        if(spnum<=10) speed=300;
        else if(spnum<=30) speed=200;
        else if(spnum<=90) speed=100;
        else if(spnum<=150) speed=50;
        else speed=30;
        Setpos(Mapsize/2,Mapsize/2),Color(1+4*((T/10)%2)),cout<<"○";
   if(win==1){return 0;}
   memset(M2,0,sizeof(M2));M2[Mapsize/2][Mapsize/2]=-1;
   int bb=0;
   if(T%Bspeed==0)
    for(int i=1;i<=bl;i++) if(B[i].life==1) {bb++;
	Setpos(B[i].x,B[i].y);cout<<"  ";
    if(B[i].x==Mapsize/2&&B[i].y==Mapsize/2) {if(B[i].w==1) Score++,system("color 6E");if(B[i].w==2) Score-=2,system("color 4F");Sleep(50),system("color 0F"),Map(1);B[i].life=0;continue;}
	if(B[i].w<=2) Move(i);Setpos(B[i].x,B[i].y);M2[B[i].x][B[i].y]=B[i].w;
    if(B[i].w==1) Color(5),cout<<"▲";
    else if(B[i].w==2) Color(4),cout<<"▼";
    else if(B[i].w==3) {Color(4),cout<<"!!";int rh=rand()%5;if(rh<3) B[i].w=1;else B[i].w=2;}
    else if(B[i].w%2==1) Color(4),cout<<"!!",B[i].w--;
    else if(B[i].w%2==0) Color(5),cout<<"!!",B[i].w--;
	}
	if(T%100==0){int kk=0;for(int hi=1;hi<Mapsize;hi++)for(int hj=1;hj<Mapsize;hj++)if(M[hi][hj]>=6) kk++;kk+=dooring+boom;int rr=rand()%2;if(rr==0&&kk<=10) M[rand()%(Mapsize/2)*2+1][rand()%(Mapsize/2)*2+1]=6+rand()%2;}
	if(T%100==0&&bb<=Mapsize*2/3){
   	for(int k=1;k<=3;k++){
   	int xx=rand()%(Mapsize-2)+1,yy=rand()%(Mapsize-2)+1;
   	if(M[xx][yy]==0&&M2[xx][yy]==0) {
   		bl++;B[bl].x=xx;B[bl].y=yy;B[bl].life=1;B[bl].turn=rand()%4+1;B[bl].w=7;break;
	}
   }}
   Sleep(50);
}
system("color 6E");for(int i=1;i<=200;i++) cout<<"YOU WIN !!  ";
}
void gz() {
    system("cls");Color(1); 
    cout<<endl<<"●是你"<<endl;
    cout<<"由上下左右键控制"<<endl<<endl;Color(5); 
    cout<<"↑←↓→是门(方向不同,如果推后有新位置给门,则可以连锁推动)"<<endl;Color(7); 
    cout<<"■是墙(也是门固定,绕着旋转的地方)"<<endl<<endl;Color(5); 
    cout<<"▲是小胎"<<endl;Color(4); 
    cout<<"▼是小怪"<<endl;Color(1); 
    cout<<"○是终点"<<endl;Color(5); 
    cout<<"小胎 和 小怪 会随机出现在地图上"<<endl;
	cout<<"你的目标是 引领小胎,阻止小怪 到达终点"<<endl<<endl;
	cout<<"道具:"<<endl<<endl;Color(3); 
    cout<<"★是炸弹(按 Z 使用,炸开四周的一切,包括小怪)"<<endl;Color(2); 
    cout<<"◆是幻门(按 X 使用,在四周刷出四扇随机方向的门)"<<endl<<endl;Color(5); 
    cout<<"一个小胎一分,20分通关!"<<endl<<endl;
    cout<<"按任意键开始!"<<endl;
    char a;a=_getch();yx();
}
int main(){ 
    system("mode con cols=62 lines=33");
    CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);srand((unsigned)time(NULL));
    star:Mapsize=30;CreatMap(2);Map(1);
    Setpos(10,10);Color(5);cout<<"欢迎来到 幻门疾走!";
	Setpos(12,10);Color(0);cout<<"作者:胎神大大(洛谷名:TSzza)";
	Setpos(14,12);cout<<"1、开始!";Setpos(16,12);cout<<"2、规则...";
	start:char a;a=_getch();if(a=='1')yx();else if(a=='2')gz();else goto start;goto star;
    return 0;
}

四、盲打

#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<time.h>
#define KEY_DOWN(VK_NONAME)((GetAsyncKeyState(VK_NONAME)&0x8000)?1:0)
using namespace std;
int to(float a) {if(a>0) return int(a+0.5);else if(a<0) return int(-a-0.5);if(a==0) return 0;}
void Setpos(float x,float y){int xx=to(x),yy=to(y*2);COORD pos;pos.X=yy,pos.Y=xx;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}
int T9_Color[10]={0,-40,-30,-31,-50,-20,-21,-60,-10,-11};  //2.0 配色方案 
int U3_Color[10]={0,-1,-70,-71};  //从上到下 
int L8_Color[10]={0,-60,-40,-20,-10,-50,-11,-21,-30};
int B26_Color[30],L26_Color[30],FJ_Color[30]; //Board区键盘上色 
void Slow(char *p) {while(1){if(*p!=0) printf("%c",*p++);else break;if(!kbhit()) Sleep(50);}}
void Slow_F(char *p) {while(1){if(*p!=0) printf("%c",*p++);else break;if(!kbhit()) Sleep(10);}}
void Color(int a){
#define SCT SetConsoleTextAttribute
#define GSH GetStdHandle(STD_OUTPUT_HANDLE)
#define WHITE FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE
    if(a==0) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);if(a==10) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);if(a==20) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_GREEN);if(a==30) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);if(a==40) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_RED);if(a==50) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);if(a==60) SCT(GSH,FOREGROUND_INTENSITY|FOREGROUND_BLUE);if(a==70) SCT(GSH,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
    if(a==71) SCT(GSH,FOREGROUND_INTENSITY);if(a==11) SCT(GSH,FOREGROUND_GREEN|FOREGROUND_BLUE);if(a==21) SCT(GSH,FOREGROUND_GREEN);if(a==31) SCT(GSH,FOREGROUND_RED|FOREGROUND_BLUE);if(a==41) SCT(GSH,FOREGROUND_RED);if(a==51) SCT(GSH,FOREGROUND_RED|FOREGROUND_GREEN);if(a==61) SCT(GSH,FOREGROUND_BLUE);if(a==-1) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE);if(a==1) SCT(GSH,0);if(a==-10) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_GREEN|BACKGROUND_BLUE);if(a==-20) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_GREEN);if(a==-30) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_BLUE);
    if(a==-40) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_RED|WHITE);if(a==-50) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_GREEN);if(a==-60) SCT(GSH,BACKGROUND_INTENSITY|BACKGROUND_BLUE|WHITE);if(a==-70) SCT(GSH,BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE);if(a==-71) SCT(GSH,BACKGROUND_INTENSITY|WHITE);if(a==-11) SCT(GSH,BACKGROUND_GREEN|BACKGROUND_BLUE|WHITE);if(a==-21) SCT(GSH,BACKGROUND_GREEN|WHITE);if(a==-31) SCT(GSH,BACKGROUND_RED|BACKGROUND_BLUE|WHITE);if(a==-41) SCT(GSH,BACKGROUND_RED|WHITE);if(a==-51) SCT(GSH,BACKGROUND_RED|BACKGROUND_GREEN|WHITE);if(a==-61) SCT(GSH,BACKGROUND_BLUE|WHITE);
}
struct TYPPER{
    char name;
    int left,up;//从左向右,从上到下 
    float x,y;//y是横列 
}T[50],Ta[50];//Ta:all,T:字母 
int N[50];//反字母对应 
void Initialization_TYPPER(){
    char T1[50]="*QWERTYUIOP[]";//字母1len=10+2 
    char T2[50]="*ASDFGHJKL;'";//字母2len=9+2 
    char T3[50]="*ZXCVBNM,./";//字母3len=7+3
    int tl=0,tal=0;
    for(int j=1;j<=3;j++) for(int i=1;i<=12;i++){
        char t0;
        if(j==1) t0=T1[i];if(j==2) t0=T2[i];if(j==3) t0=T3[i];
        if(t0>='A'&&t0<='Z'){tl++;T[tl].name=t0;T[tl].left=i;T[tl].up=j;T[tl].x=4*j-1;T[tl].y=4*i-1;if(j==2) T[tl].y+=1;if(j==3) T[tl].y+=3;N[t0-'A'+1]=tl;}
        if(t0!=0){tal++;Ta[tal].name=t0;Ta[tal].left=i;Ta[tal].up=j;Ta[tal].x=4*j-1;Ta[tal].y=4*i-1;if(j==2) Ta[tal].y+=1;if(j==3) Ta[tal].y+=3;
        }
    }
    B26_Color['W'-'A'+1]=T9_Color[2];B26_Color['A'-'A'+1]=T9_Color[2];B26_Color['S'-'A'+1]=T9_Color[2];B26_Color['D'-'A'+1]=T9_Color[2];B26_Color['Q'-'A'+1]=T9_Color[1];B26_Color['E'-'A'+1]=T9_Color[4];B26_Color['R'-'A'+1]=T9_Color[4];B26_Color['T'-'A'+1]=T9_Color[4];B26_Color['Y'-'A'+1]=T9_Color[4];B26_Color['F'-'A'+1]=T9_Color[5];B26_Color['G'-'A'+1]=T9_Color[5];B26_Color['H'-'A'+1]=T9_Color[5];B26_Color['Z'-'A'+1]=T9_Color[3];B26_Color['X'-'A'+1]=T9_Color[3];B26_Color['C'-'A'+1]=T9_Color[3];B26_Color['V'-'A'+1]=T9_Color[3];B26_Color['B'-'A'+1]=T9_Color[6];for(char i='I';i<='P';i++) B26_Color[i-'A'+1]=T9_Color[9];B26_Color['U'-'A'+1]=T9_Color[7];B26_Color['I'-'A'+1]=T9_Color[7];B26_Color['O'-'A'+1]=T9_Color[7];
    //B26_Color定义 
    for(int i=1;i<=26;i++){if(T[i].left<=5) L26_Color[T[i].name-'A'+1]=L8_Color[i];
    if(T[i].left<=5) L26_Color[T[i].name-'A'+1]=L8_Color[T[i].left];
    else if(T[i].up==1&&T[i].left>=6) L26_Color[T[i].name-'A'+1]=L8_Color[max(5,T[i].left-2)];
    else if(T[i].up==2&&T[i].left>=6) L26_Color[T[i].name-'A'+1]=L8_Color[T[i].left-1];
    else if(T[i].up==3&&T[i].left>=6) L26_Color[T[i].name-'A'+1]=L8_Color[T[i].left];
    }
    //L26_Color定义 
}
void TEST_FJ();void TEACH_Board_TEST(int a);void TEACH_Board_Left();void TEACH_Board_Right();void TEACH_Board_Mid();void TEACH_Board_Remember();void TEACH_Board_Word();
int UP=2;void TYPPER_UP();
#define PSK Setpos(T[i].x,T[i].y),cout<<"       ";Setpos(T[i].x+1,T[i].y),cout<<"   "<<T[i].name<<"   ";Setpos(T[i].x+2,T[i].y),cout<<"       "
void Print_Single_Key_Char(char a) {int i=N[a-'A'+1];Color(-70);PSK;}
void Print_Single_Key_Int(int i) {Color(-70);PSK;}
void Print_Single_Key_Char_C(char a,int color) {int i=N[a-'A'+1];Color(color);PSK;}
void Print_Single_Key_Int_C(int i,int color) {Color(color);PSK;}
void Print_Local_Key_C(char local,char name,int color) {if(local>'a'&&local<'z')local+='A'-'a';if(local<'A'||local>'Z') return;int i=N[local-'A'+1];Color(color);Setpos(T[i].x,T[i].y),cout<<"       ";Setpos(T[i].x+1,T[i].y),cout<<"   "<<name<<"   ";Setpos(T[i].x+2,T[i].y),cout<<"       ";}
void Print_Hole_TYPPER_Key(){for(int i=1;i<=26;i++)Print_Single_Key_Int(i);}
void Print_Hole_TYPPER_Key_S(int sleep) {for(int i=1;i<=26;i++)Print_Single_Key_Int(i),Sleep(sleep);}
void Print_Hole_TYPPER_Key_L26() {for(int i=1;i<=26;i++) Print_Single_Key_Int_C(i,L26_Color[T[i].name-'A'+1]);}
void Print_Hole_TYPPER_Key_B26() {for(int i=1;i<=26;i++) Print_Single_Key_Int_C(i,B26_Color[T[i].name-'A'+1]);}
void Print_Hole_TYPPER_Key_L26_S(int sleep) {for(int i=1;i<=26;i++) Print_Single_Key_Int_C(i,L26_Color[T[i].name-'A'+1]),Sleep(sleep);}
void Print_Hole_TYPPER_Key_B26_S(int sleep) {for(int i=1;i<=26;i++) Print_Single_Key_Int_C(i,B26_Color[T[i].name-'A'+1]),Sleep(sleep);}
void Print_Frame(){for(int i=UP;i<=min(39,UP+13);i++){Setpos(i,2);Color(-1);if(i==UP+13)Color(-71);for(int j=1;j<=83;j++) printf(" ");}}
void Print_Frame_Line(int color){int i=15; Setpos(i,2);Color(color);for(int j=1;j<=83;j++) printf(" ");}
void Print_Frame_Line_FJ(int color){int i=16; Setpos(i,2);Color(color);for(int j=1;j<=83;j++) printf(" ");}
void Print_Hole_TYPPER(){Print_Frame();Print_Hole_TYPPER_Key();}
void Print_Hole_TYPPER_Board(){Print_Frame();for(int i=1;i<=26;i++) Print_Single_Key_Char_C('A'-1+i,B26_Color[i]);}
void Print_Hole_TYPPER_Finger(){Print_Frame();for(int i=1;i<=26;i++) Print_Single_Key_Char_C('A'-1+i,L26_Color[i]);}
void Spark_Key(char a,int color,int sleep){Print_Single_Key_Char_C(a,color);Sleep(sleep);Print_Single_Key_Char_C(a,-71);Sleep(sleep);Print_Single_Key_Char_C(a,color);Sleep(sleep);Print_Single_Key_Char_C(a,-71);Sleep(sleep);Print_Single_Key_Char_C(a,color);Sleep(sleep*2);}
void Spark_Key_Right(char a,int color,int sleep){int c=-20;Print_Single_Key_Char_C(a,color);Sleep(sleep);Print_Single_Key_Char_C(a,-20);Sleep(sleep);Print_Single_Key_Char_C(a,color);Sleep(sleep);Print_Single_Key_Char_C(a,-20);Sleep(sleep);Print_Single_Key_Char_C(a,color);Sleep(sleep*2);}
void Spark_Key_Wrong(char a,int color,int sleep){Print_Single_Key_Char_C(a,color);Sleep(sleep);Print_Single_Key_Char_C(a,-41);Sleep(sleep);Print_Single_Key_Char_C(a,color);Sleep(sleep);Print_Single_Key_Char_C(a,-41);Sleep(sleep);Print_Single_Key_Char_C(a,color);Sleep(sleep*2);}
void Print_Hole_TYPPER_Dark(){for(char i=1;i<=26;i++) Print_Single_Key_Int_C(i,-71),Sleep(20);}
void Print_Hole_TYPPER_None(){for(char i=1;i<=30;i++) {if(i>=4&&i<=30) Print_Local_Key_C(i+'A'-1-4,'?',-70);if(i>=1&&i<=26) Print_Local_Key_C(i+'A'-1,'?',-71);Sleep(20);}}
void Print_String_Key_Char(char a[100]){char t=0;for(int i=0;i<=99;i++){if(a[i]!=0) t=a[i];else break;if(t>='a'&&t<='z') t+='A'-'a';if(t>='A'&&t<='Z') Print_Single_Key_Char(t);}}
void Print_String_Key_Char_C(char a[100],int color){char t=0;for(int i=0;i<=99;i++){if(a[i]!=0) t=a[i];else break;if(t>='a'&&t<='z') t+='A'-'a';if(t>='A'&&t<='Z') Print_Single_Key_Char_C(t,color);}}
void Print_String_Key_Char_C_S(char a[100],int color,int sleep){char t=0;for(int i=0;i<=99;i++){if(a[i]!=0) t=a[i];else break;if(t>='a'&&t<='z') t+='A'-'a';if(t>='A'&&t<='Z') Print_Single_Key_Char_C(t,color);Sleep(sleep);}}

void Point(){for(int i=0;i<=36;i+=3) for(int j=0;j<=42;j+=7)Setpos(i,j),cout<<'*'<<'('<<i<<','<<j<<')';for(int i=1;i<=34;i+=3) for(int j=3;j<=39;j+=7)Setpos(i,j),cout<<'*'<<'('<<i<<','<<j<<')';}
void Slow_Frame(int x0,int y0,int x1,int y1){Color(0);
	for(int i=y0;i<=y1;i++) Setpos(x0,i),printf("*"),Sleep(2);
	for(int i=x0;i<=x1;i++) Setpos(i,y0),printf("*"),Setpos(i,y1),printf("*"),Sleep(2);
	for(int i=y0;i<=y1;i++) Setpos(x1,i),printf("*"),Sleep(2);
}void Frame(int x0,int y0,int x1,int y1){Color(0);
	for(int i=y0;i<=y1;i++) Setpos(x0,i),printf("*");
	for(int i=x0;i<=x1;i++) Setpos(i,y0),printf("*"),Setpos(i,y1),printf("*");
	for(int i=y0;i<=y1;i++) Setpos(x1,i),printf("*");
}
void Dark_Frame(int x0,int y0,int x1,int y1){Color(0);for(register int i=x0;i<=x1;i++)for(register int j=y0;j<=y1;j++) Setpos(i,j),printf("  ");}
void Dark_Frame_L(int x0,int y0,int x1,int y1){Color(0);for(register int j=y1;j>=y0;j--) Dark_Frame(x0,j,x1,j),Sleep(5);}
int Step_X(int x0,int y0,int x1,int y1,int step,int stepmax) {float s=(x1-x0)*1.0/stepmax*1.0;return int(x0+s*step);}
int Step_Y(int x0,int y0,int x1,int y1,int step,int stepmax) {float s=(y1-y0)*1.0/stepmax*1.0;return int(y0+s*step);}
void Light_L8(int colornum){for(int i=1;i<=26;i++){if(L26_Color[i]==L8_Color[colornum])Spark_Key(i+'A'-1,L8_Color[colornum],30);}}
void Light_String_T9(char a[100],int color){char t=0;for(int i=0;i<=99;i++){if(a[i]!=0) t=a[i];else break;if(t>='a'&&t<='z') t+='A'-'a';if(t>='A'&&t<='Z') Spark_Key(t,T9_Color[color],30);}}
void Print_Board_Name(){
Dark_Frame(2,25,8,40);
Slow_Frame(1,26,9,44);
	Setpos(3,25+3),Color(T9_Color[1]),Slow_F(" QWER ");Sleep(100);
	Setpos(3,30+3),Color(T9_Color[4]),Slow_F(" ERTY ");Sleep(100);
	Setpos(3,35+3),Color(T9_Color[7]),Slow_F(" UIOP ");Sleep(100);
	Setpos(5,26+3),Color(T9_Color[2]),Slow_F(" ASDF ");Sleep(100);
	Setpos(5,31+3),Color(T9_Color[5]),Slow_F(" FGHJ ");Sleep(100);
	Setpos(5,36+3),Color(T9_Color[8]),Slow_F(" JKL; ");Sleep(100);
	Setpos(7,28+3),Color(T9_Color[3]),Slow_F(" ZXCV ");Sleep(100);
	Setpos(7,33+3),Color(T9_Color[6]),Slow_F(" BNM, ");Sleep(100);
}
void TEACH_Board_Remember(){Initialization_TYPPER();
	Slow_Frame(1,1,9,36);
	Setpos(3,3);Slow("有可能你觉得键盘背诵是件很难的事情");Sleep(500);
	Setpos(5,3);Slow("没有关系,我们先来整体感知一下");Sleep(500);
	Setpos(7,3);Slow("先大致了解一下键盘的分区吧:");
	for(int i=1;i<=26;i++){T[i].x+=8;}
	Light_String_T9("WASD",2); Setpos(23,4),Slow_F("这是 WASD 区,经常玩4399等小游戏的男生们应该对此区非常的了解!");
	Light_String_T9("Q",1);		Setpos(25,4),Slow_F("在它的左上方是 Q ,因为太不常用了,所以被挤到了这么偏远的地方...");
	Light_String_T9("ZXCV",3); Setpos(27,4),Slow_F("位于键盘左下角的 Ctrl 区,相信经常使用电脑的人都不会不熟悉...");
	Light_String_T9("ERTY",4); Setpos(29,4),Slow_F("在键盘的中上方,聚集着一堆英文单词的“字母后缀”(-er,-ty)");
	Light_String_T9("FGH",5); Setpos(31,4),Slow_F("在后缀区下方,排列着 F G H 三个字母,嗯,这个区就叫 中继(G)区 吧!");
	Light_String_T9("B",6);		Setpos(33,4),Slow_F("对了,键盘正中最下方是字母 B ");
	Light_String_T9("UIO",7);Light_String_T9("P",9); Setpos(35,4),Slow_F("与后缀区相对,在键盘的右上方是元音区,区末以P结尾,与Q遥相呼应");
	Light_String_T9("JKLNM",8);Setpos(37,4),Slow_F("键盘的右下方,有一堆相邻字母组合在一起的区域,从 J 到 M ,我们就把它称作 MJ 区吧。");
	Sleep(500);
	Color(-50); Setpos(33,29);Slow("   "),system("pause");
	Dark_Frame_L(10,2,37,45);
	Dark_Frame(2,2,8,23);
	Setpos(3,3);Slow("其实你看,你已经对这个键盘有一定了解了不是吗?");Sleep(500);
	Setpos(5,3);Slow("接下来我们要做的,只不过是将这些零碎的分区系统地串联起来罢了。");Sleep(500);
	Setpos(7,3);Slow("接下来,我们就开始学习键盘真正的分区吧!");
	Print_Board_Name();
	Light_String_T9("QWER",1);Setpos(23,4),Slow_F("这四个字母简直是“梦开始的地方”,是笔者背得最熟的。其实就想像背圆周率一样,前几位都是莫名其妙就可以记得很牢的。Anyway,要是想不到口诀,“酷儿”怎么样?");
	T[N['E'-'A'+1]].x--;T[N['R'-'A'+1]].x--;
	Light_String_T9("ERTY",4);Setpos(25,4),Slow_F("“左上的后缀区”,尽管RTY都在食指右上,Y甚至还要用右手按(事实上Y和B一样,是键盘中最难够到的两个中心字母)。。。音近“二体”,个人感觉不用口诀也能记!");
	Light_String_T9("UIOP",7);Setpos(27,4),Slow_F("“右上的元音区”,加了个P。在键盘里,P和Q位于两侧遥遥相对,遥相呼应,有一种美感呢。至于元音区,食指U中指I无名指O,后面会有专门的针对练习!(另:P是右小指控制的唯一字母呢)");
	Light_String_T9("ASDF",2);Setpos(29,4),Slow_F("A左  S下蹲/防御  D右,这顺序记牢!F是食指正按的字母,ASDF是左手四指正按的字母!");
	T[N['F'-'A'+1]].x--;
	Light_String_T9("FGHJ",5);Setpos(31,4),Slow_F("“完整版中G区”,叫“中GH区”更合适!FGHJ连续四个字母,二食指互控,真正的键盘中心!(正按:左F右J,键盘上应该有小凸起指示)");
	T[N['J'-'A'+1]].x--;
	Light_String_T9("JKL",8);Setpos(33,4),Slow_F("“JKL;”小指开始没事干了,注意啦!依然是连续字母,右手三指正按!");
	Light_String_T9("ZXCV",3);Setpos(35,4),Slow_F("“左下的Ctrl区”,这顺序不需要我说了吧?");
	Light_String_T9("BNM",6);Setpos(37,4),Slow_F("这仨字母老是有点像宝马“BMW”, 谐音“巴拿马”。。。注意这区已经不算右下了,BNM都属于右手食指控制的区域!(中指逗号无名指句号小指顿号,这个我们程序不教。)");
	Sleep(500);
	Color(-50); Setpos(35,27);Slow("   "),system("pause");
	Dark_Frame_L(10,0,39,45);
	Dark_Frame(2,2,8,24);
	Setpos(3,3);Slow("该练点题了!");Sleep(500);
	Setpos(5,3);Slow("反正先学的是大致印象,记不牢也没关系!");Sleep(500);
	Setpos(7,3);Slow("不会难为你的,我们从判断题开始!");
system("cls");
}
void Print_String_C(char a[30],int c){Print_String_Key_Char_C(a,c);}
void Print_String_T9(char a[30],int c){Print_String_Key_Char_C(a,T9_Color[c]);}
void Spark_String_T9(char a[30],int c){Print_String_T9(a,c);Sleep(30);Print_String_C(a,-71);Sleep(30);Print_String_T9(a,c);Sleep(30);Print_String_C(a,-71);Sleep(30);Print_String_T9(a,c);Sleep(30);Print_String_C(a,-71);Sleep(30);Print_String_T9(a,c);Sleep(60);}
void TEACH_Board_Mid(){Initialization_TYPPER();
	Slow_Frame(1,1,9,33);
	Setpos(3,3);Slow("恭喜通过右手试炼!接下来我们学习中间部分吧!");Sleep(500);
	Setpos(5,3);Slow("事实上,中间部分你已经基本背到了!");Sleep(500);
	Setpos(7,3);Slow("我们迅速的来过一下!");
	Sleep(500);
	char Ch[13]="TY  GH  BN  ";int x0[12],y0[12],x1[12],y1[12],c[12];
	for(int i=0;i<=11;i++){if(Ch[i]==' ')continue;char a=Ch[i];int j=N[a-'A'+1];T[j].x+=8;}
	Print_String_Key_Char_C_S("TGB",T9_Color[4],30);Print_String_Key_Char_C_S("YHN",T9_Color[6],30);Sleep(800);
	for(int i=0;i<=11;i++){if(Ch[i]==' ')continue;char a=Ch[i];int j=N[a-'A'+1];x0[i]=T[j].x;y0[i]=T[j].y;if(i<4) x1[i]=19;else if(i<8) x1[i]=23;else x1[i]=27;if(i%4==0) y1[i]=3;if(i%4==1) y1[i]=7;if(i%4==2) y1[i]=11;if(i%4==3) y1[i]=15;x1[i]+=2,y1[i]+=3;c[i]=T9_Color[(i%4)*2+4];}
	int step=0,stepmax=7;
	while(step<stepmax)
	{
		step++;
		for(int i=0;i<=11;i++){
			char a=Ch[i];int j=N[a-'A'+1];
			Print_Single_Key_Int_C(j,1);
			T[j].x=Step_X(x0[i],y0[i],x1[i],y1[i],step,stepmax);
			T[j].y=Step_Y(x0[i],y0[i],x1[i],y1[i],step,stepmax);
			Print_Single_Key_Int_C(j,c[i]);
		}
		Sleep(50);
	}
Print_String_Key_Char_C_S("TGB",T9_Color[4],30);Print_String_Key_Char_C_S("YHN",T9_Color[6],30);
	Sleep(800);
	Spark_String_T9("TY",4);
	Setpos(11,2),Slow("  中间上区:TY  ");Color(0),printf(" — — “ERTY的后面部分” ! 左 T 右 Y !");
	Sleep(500);Spark_String_T9("GH",5);
	Setpos(13,2),Slow("  中间中区:GH  ");Color(0),printf(" — — “FGHJ的中间部分” ! 左 G 右 H !");
	Sleep(500);Spark_String_T9("BN",6);
	Setpos(15,2),Slow("  中间下区:BN  ");Color(0),printf(" — — “BNM区的前端部分”! 左 B 右 N !");
	Sleep(500);Color(T9_Color[7]);
	Setpos(17,2),Slow("  ...另:中左 TGB ,中右 YHN : ");Color(0),printf(" — — 要是真的还是需要口诀的话,那就左手“舔狗棒”,右手“诱惑你”!");
	Sleep(500);
	Slow_Frame(19,21,33,43);
	Setpos(21,23);Slow("TY GH BN TGB YHN,记住了吗?");Sleep(500);
	Setpos(23,23);Slow("事不宜迟,我们马上做个巩固测试!");Sleep(500);
	Setpos(25,23);Slow("做完之后,我们就进入");Sleep(500);
	Setpos(27,24);Slow("“键盘背诵篇 之 最终考验”!");Sleep(500);
	Color(-50); Setpos(31,23);Slow("   按任意键开始   ");
	Color(0),Setpos(7,3),system("pause");
}
void TEACH_Board_Right(){Initialization_TYPPER();
	Slow_Frame(1,1,9,33);
	Setpos(3,3);Slow("恭喜通过左手试炼!你已经背下半个键盘了,加油!");Sleep(500);
	Setpos(5,3);Slow("相较于左手,右手键盘虽然少,但是易混易错,难度较大!");Sleep(500);
	Setpos(7,3);Slow("来吧!让我们开始学习右手键盘!");
	Sleep(500);
	char Ch[13]="UIOPJKL M   ";int x0[12],y0[12],x1[12],y1[12],c[12];
	for(int i=0;i<=11;i++){if(Ch[i]==' ')continue;char a=Ch[i];int j=N[a-'A'+1];T[j].x+=8;}
	Print_String_Key_Char_C_S("UIOP",T9_Color[7],30);Print_String_Key_Char_C_S("JKL",T9_Color[8],30);Print_String_Key_Char_C_S("M",T9_Color[9],30);
	Dark_Frame(2,2,8,32);
	Setpos(3,3);Slow("这就是右手边的键盘");Sleep(500);
	Setpos(5,3);Slow("同样,看着它们硬背是不行的...");Sleep(500);
	Setpos(7,3);Slow("让我们再次把每个键分配到手指!");
	for(int i=0;i<=11;i++){if(Ch[i]==' ')continue;char a=Ch[i];int j=N[a-'A'+1];x0[i]=T[j].x;y0[i]=T[j].y;if(i<4) x1[i]=19;else if(i<8) x1[i]=23;else x1[i]=27;if(i%4==0) y1[i]=3;if(i%4==1) y1[i]=7;if(i%4==2) y1[i]=11;x1[i]+=2;if(i%4==3) y1[i]=15;c[i]=T9_Color[i/4+1+7];}
	int step=0,stepmax=7;
	while(step<stepmax)
	{
		step++;
		for(int i=0;i<=11;i++){
			char a=Ch[i];int j=N[a-'A'+1];
			Print_Single_Key_Int_C(j,1);
			T[j].x=Step_X(x0[i],y0[i],x1[i],y1[i],step,stepmax);
			T[j].y=Step_Y(x0[i],y0[i],x1[i],y1[i],step,stepmax);
			Print_Single_Key_Int_C(j,c[i]);
		}
		Sleep(50);
	}
Print_String_Key_Char_C_S("UIOP",-70,30);Print_String_Key_Char_C_S("JKL",-70,30);Print_String_Key_Char_C_S("M",-70,30);
	Sleep(800);
	Spark_String_T9("UIOP",7);
	Setpos(11,2),Slow("  右手上区:元音加P  ");Color(0),printf(" — — 这里我们用横向背诵法!“食物”=“食指按U”,“中医”=“中指按I”,“无名指又叫环指”=“环指按O”,“小指算个P”=...");
	Sleep(500);Spark_String_T9("JKL",8);
	Setpos(13,2),Slow("  右手中区:金坷垃;  ");Color(0),printf(" — — 控制三个连续的字母 J K L ,“食鸡(时机)”=“食指按J”,“中开”=“中指按K”,“环指代表恋”=“环指按L”,小指没事干!");
	Sleep(500);Spark_String_T9("M",9);
	Setpos(15,2),Slow("  右手下区:M  ");Color(0),printf(" — — BNM区的一部分,这三个键都由右手中指控制!你要是把这区翻译成“把你妹”也没人拦你...");
	Sleep(500);T[N['U'-'A'+1]].x--;T[N['J'-'A'+1]].x--;T[N['M'-'A'+1]].x--;Spark_String_T9("UJM",5);
	Setpos(17,2),Slow("  右手食指:“食”指  ");Color(0),printf(" — — 右手唯一口诀:“无菌米”,和食指的名字很搭嘛,脑补无脑广告:“今晚吃什么?!当然是无!菌!米!(什么垃圾玩意儿)");
	Sleep(500);
	Slow_Frame(19,21,33,43);
	Setpos(21,23);Slow("右手易混易错,一定要背牢哦");Sleep(500);
	Setpos(23,23);Slow("话说这口诀还是真的难(zhi)编(zhang)...");Sleep(500);
	Setpos(25,23);Slow("算啦,反正最后是肌肉记忆,能用就行!");Sleep(500);
	Setpos(27,23);Slow("UIOP JKL M UJM ,记住了吗?");Sleep(500);
	Setpos(29,23);Slow("记住了后,我们就做一个巩固测试!");Sleep(500);
	Color(-50); Setpos(31,23);Slow("   按任意键开始   ");
	Color(0),Setpos(3,3),system("pause");
}
void TEACH_Board_Left(){Initialization_TYPPER();
	Slow_Frame(1,1,9,30);
	Setpos(3,3);Slow("要知道,只要键盘背的好,打字速度自然快");Sleep(500);
	Setpos(5,3);Slow("当然,不是死记硬背,是形成肌肉记忆");Sleep(500);
	Setpos(7,3);Slow("接下来,本程序将帮助你再次!精确地背诵整个键盘!");
	Sleep(500);
	char Ch[13]="QWERASDFZXCV";int x0[12],y0[12],x1[12],y1[12],c[12];
	for(int i=0;i<=11;i++){char a=Ch[i];int j=N[a-'A'+1];T[j].x+=8;}
	Print_String_Key_Char_C_S("QWER",T9_Color[1],30);Print_String_Key_Char_C_S("ASDF",T9_Color[2],30);Print_String_Key_Char_C_S("ZXCV",T9_Color[3],30);
	Dark_Frame(2,2,8,28);
	Setpos(3,3);Slow("这就是左手边的键盘");Sleep(500);
	Setpos(5,3);Slow("看着它们硬背是不行的...");Sleep(500);
	Setpos(7,3);Slow("让我们把每个键分配到手指!");
	for(int i=0;i<=11;i++){char a=Ch[i];int j=N[a-'A'+1];x0[i]=T[j].x;y0[i]=T[j].y;if(i<4) x1[i]=19;else if(i<8) x1[i]=23;else x1[i]=27;if(i%4==3) y1[i]=3;if(i%4==2) y1[i]=7;if(i%4==1) y1[i]=11;if(i%4==0) y1[i]=15;x1[i]+=2;c[i]=T9_Color[i/4+1];}
	int step=0,stepmax=7;
	while(step<stepmax)
	{
		step++;
		for(int i=0;i<=11;i++){
			char a=Ch[i];int j=N[a-'A'+1];
			Print_Single_Key_Int_C(j,1);
			T[j].x=Step_X(x0[i],y0[i],x1[i],y1[i],step,stepmax);
			T[j].y=Step_Y(x0[i],y0[i],x1[i],y1[i],step,stepmax);
			Print_Single_Key_Int_C(j,c[i]);
		}
		Sleep(50);
	}
Print_String_Key_Char_C("QWER",T9_Color[1]);Print_String_Key_Char_C("ASDF",T9_Color[2]);Print_String_Key_Char_C("ZXCV",T9_Color[3]);	
	Sleep(800);
	Light_L8(4);
	Setpos(11,2),Slow("  左手食指:玄指  ");Color(0),printf(" — — R F V ...三个感觉有点神秘的字母,连读叫做“人非鱼”");
	Sleep(500);Light_L8(3);
	Setpos(13,2),Slow("  左手中指:三指  ");Color(0),printf(" — — 控制三个连续的字母 C D E ,C又在字母表排第三,看来它跟三蛮有缘的");
	Sleep(500);Light_L8(2);
	Setpos(15,2),Slow("  左无名指:我指  ");Color(0),printf(" — — 三个字母分别是 W S X,连起来读...我是(sha)仙(cha)...");
	Sleep(500);Light_L8(1); 
	Setpos(17,2),Slow("  左手小指:边指  ");Color(0),printf(" — — 所控制的三个字母都是最偏远的字母:最前头,最后头,最少用");
	Sleep(500);
	Slow_Frame(19,21,33,43);
	Setpos(21,23);Slow("这就是每个手指的对应键了");Sleep(500);
	Setpos(23,23);Slow("话说这口诀是真的难(zhi)编(zhang)...");Sleep(500);
	Setpos(25,23);Slow("算啦,反正最后是肌肉记忆,能用就行!");Sleep(500);
	Setpos(27,23);Slow("RFV EDC WSX QAZ ,记住了吗?");Sleep(500);
	Setpos(29,23);Slow("记住了后,我们就做一个巩固测试!");Sleep(500);
	Color(-50); Setpos(31,23);Slow("   按任意键开始   ");
	Color(0),Setpos(3,3),system("pause");
}
float Sin(int i){return sin(3.1416*i/180);}
float Cos(int i){return cos(3.1416*i/180);}
float Tan(int i){return tan(3.1416*i/180);}
void Print_Left(){Print_String_Key_Char("QWERASDFZXCV");}
void Print_Left_C(){Print_String_Key_Char_C("QWER",T9_Color[1]);Print_String_Key_Char_C("ASDF",T9_Color[2]);Print_String_Key_Char_C("ZXCV",T9_Color[3]);}
void Spark_Left(){Print_Left_C();Sleep(60);Print_Left();Sleep(60);Print_Left_C();Sleep(60);Print_Left();Sleep(60);Print_Left_C();Sleep(60);Print_Left();Sleep(60);}
void Slow_Left(){Print_String_Key_Char_C_S("QWER",T9_Color[1],30);Print_String_Key_Char_C_S("ASDF",T9_Color[2],30);Print_String_Key_Char_C_S("ZXCV",T9_Color[3],30);}
void Print_Right(){Print_String_Key_Char("UIOPJKLM");}
void Print_Right_C(){Print_String_Key_Char_C("UIOP",T9_Color[7]);Print_String_Key_Char_C("JKL",T9_Color[8]);Print_String_Key_Char_C("M",T9_Color[9]);}
void Spark_Right(){Print_Right_C();Sleep(60);Print_Right();Sleep(60);Print_Right_C();Sleep(60);Print_Right();Sleep(60);Print_Right_C();Sleep(60);Print_Right();Sleep(60);}
void Slow_Right(){Print_String_Key_Char_C_S("UIOP",T9_Color[7],30);Print_String_Key_Char_C_S("JKL",T9_Color[8],30);Print_String_Key_Char_C_S("M",T9_Color[9],30);}
void Print_Mid(){Print_String_Key_Char("YHNUJM");}
void Print_Mid_C(){Print_String_Key_Char_C("YHN",T9_Color[4]);Print_String_Key_Char_C("UJM",T9_Color[6]);}
void Spark_Mid(){Print_Mid_C();Sleep(60);Print_Mid();Sleep(60);Print_Mid_C();Sleep(60);Print_Mid();Sleep(60);Print_Mid_C();Sleep(60);Print_Mid();Sleep(60);}
void Slow_Mid(){Print_String_Key_Char_C_S("YHN",T9_Color[4],30);Print_String_Key_Char_C_S("UJM",T9_Color[6],30);}
void Spark_All(){Print_Hole_TYPPER_Key_B26();Sleep(30);Print_Hole_TYPPER_Key();Sleep(30);Print_Hole_TYPPER_Key_B26();Sleep(30);Print_Hole_TYPPER_Key();Sleep(30);Print_Hole_TYPPER_Key_B26();Sleep(30);Print_Hole_TYPPER_Key();Sleep(30);}
void Slow_All(){Print_Hole_TYPPER_Key_B26_S(15);}

bool Q[30];//问过没有 
int Rightmax,Right_Count;
void Print_Right_Count(int x,int y){
	Setpos(x,y),Color(-70);for(int i=1;i<=Rightmax+2;i++)cout<<"  ";
	Setpos(x+1,y),Color(-70);cout<<"  ";Color(20);for(int i=1;i<=Right_Count;i++)cout<<"■";Color(0),cout<<"  ";Setpos(x+1,y+1+Rightmax),Color(-70);cout<<"  ";
	Setpos(x+2,y),Color(-70);for(int i=1;i<=Rightmax+2;i++)cout<<"  ";
}
#define PLK Setpos(x,y),cout<<"       ";Setpos(x+1,y),cout<<"   "<<a<<"   ";Setpos(x+2,y),cout<<"       "
void Print_Located_Key_Char(char a,int x,int y) {int i=N[a-'A'+1];Color(-70);PLK;}
void Print_Located_Key_Char_C(char a,int x,int y,int color) {int i=N[a-'A'+1];Color(color);PLK;}
void Jump_Que(char Que,int x,int y,int color){Dark_Frame(x+2,y,x+2,y+3);Print_Located_Key_Char_C(Que,x-1,y,color);Sleep(30);Dark_Frame(x+1,y,x+1,y+3);Print_Located_Key_Char_C(Que,x-2,y,color);Sleep(40);Dark_Frame(x-2,y,x-2,y+3);Print_Located_Key_Char_C(Que,x-1,y,color);Sleep(30);Dark_Frame(x-1,y,x-1,y+3);Print_Located_Key_Char_C(Que,x,y,color);}
void Jump_Que_F(char Que,int x,int y,int color){Dark_Frame(x+2,y,x+2,y+3);Print_Located_Key_Char_C(Que,x-1,y,color);Sleep(10);Dark_Frame(x+1,y,x+1,y+3);Print_Located_Key_Char_C(Que,x-2,y,color);Sleep(20);Dark_Frame(x-2,y,x-2,y+3);Print_Located_Key_Char_C(Que,x-1,y,color);Sleep(10);Dark_Frame(x-1,y,x-1,y+3);Print_Located_Key_Char_C(Que,x,y,color);}
bool String_Belong(char a,char b[40]){if(a>'a'&&a<'z') a+='A'-'a';for(int i=0;i<40;i++){if(b[i]>'a'&&b[i]<'z') b[i]+='A'-'a';if(b[i]==a) return 1;if(b[i]==0) break;}return 0;}
void Tips(char Que,int a){Color(0);
	if(a==1){
		Setpos(23,25);Slow(" Tips1:");
		Setpos(24,26);
		R1:int r=rand()%15;
		if(r==0&&String_Belong(Que,"WASD")) {Slow("它属于WASD区");return;}
		if(r==1&&String_Belong(Que,"QWER")) {Slow("它属于QWER区");return;}
		if(r==2&&String_Belong(Que,"ASDF")) {Slow("它属于ASDF区");return;}
		if(r==3&&String_Belong(Que,"ZXCV")) {Slow("它属于Ctrl区(ZXCV)");return;}
		if(r==4&&String_Belong(Que,"ERTY")) {Slow("它属于后缀区(ERTY)");return;}
		if(r==5&&String_Belong(Que,"UIO")) {Slow("它属于元音区(UIO)");return;}
		if(r==6&&String_Belong(Que,"FGH")) {Slow("它属于中G区(FGH)");return;}
		if(r==7&&String_Belong(Que,"JKLNM")) {Slow("它属于MJ区(J~M)");return;}
		if(r==8&&String_Belong(Que,"QAZPL")) {Slow("它在边角上");return;}
		if(r==9&&String_Belong(Que,"TYUGHB")) {Slow("它是键盘中间那六个之一");return;}
		if(r==10&&String_Belong(Que,"QWERASDFZXCVTG")) {Slow("它要用左手按");return;}
		if(r==10&&String_Belong(Que,"YUIOPHJKLNM")) {Slow("它要用右手按");return;}
		if(r==11&&String_Belong(Que,"QWERTYUIOP")) {Slow("它在键盘最上一行");return;}
		if(r==12&&String_Belong(Que,"ASDFGHJKL")) {Slow("它在键盘中间一行");return;}
		if(r==13&&String_Belong(Que,"ZXCVBNM")) {Slow("它在键盘下面一行");return;}
		goto R1; 
	}
	if(a==2){
		Setpos(25,25);Slow(" Tips2:");
		Setpos(26,26);
		R2:int r=rand()%3;
		if(String_Belong(Que,"QAZ")) {Slow("它是三个“最”之一(QAZ)");return;}
		if(String_Belong(Que,"WSX")) {Slow("它在“我是仙”里(WSX)");return;}
		if(String_Belong(Que,"EDC")) {Slow("它和三很有缘分(EDC)");return;}
		if(String_Belong(Que,"RFV")) {Slow("它很玄学,“人非鱼”(RFV)");return;}
		if(r==0&&String_Belong(Que,"BNM")) {Slow("它在“巴拿马”里(BNM)");return;}
		if(r==1&&String_Belong(Que,"TGB")) {Slow("它在“舔狗棒”里(TGB)");return;}
		if(r==2&&String_Belong(Que,"YHN")) {Slow("它在“诱惑你”里(YHN)");return;}
		if(r==2&&String_Belong(Que,"UJM")) {Slow("它在“无菌米”里(UJM)");return;}
		if(r==1&&String_Belong(Que,"UJ")) {Slow("它在“食物食鸡”里(UJ)");return;}
		if(String_Belong(Que,"IK")) {Slow("它在“中医中开”里(IK)");return;}
		if(String_Belong(Que,"OL")) {Slow("它在“环指环恋”里(OL)");return;}
		if(String_Belong(Que,"P")) {Slow("它与 Q 遥相呼应");return;}
		goto R2; 
	}
	if(a==3){
		Setpos(27,25);Slow(" Tips3:");
		Setpos(28,26);
		if(String_Belong(Que,"Q")) {Slow("它在最左上角哦,用小指按吧");return;}
		if(String_Belong(Que,"W")) {Slow("它在左无名指上方!");return;}
		if(String_Belong(Que,"E")) {Slow("它在左手中指上方!");return;}
		if(String_Belong(Que,"R")) {Slow("它在左手食指上方!");return;}
		if(String_Belong(Que,"T")) {Slow("它在左手食指右上方!");return;}
		if(String_Belong(Que,"P")) {Slow("它在右手小指上方!");return;}
		if(String_Belong(Que,"O")) {Slow("它在右无名指上方!");return;}
		if(String_Belong(Que,"I")) {Slow("它在右手中指上方!");return;}
		if(String_Belong(Que,"U")) {Slow("它在右手食指上方!");return;}
		if(String_Belong(Que,"H")) {Slow("它在右手食指左边!");return;}
		if(String_Belong(Que,"G")) {Slow("它在左手食指右边!");return;}
		if(String_Belong(Que,"Y")) {Slow("它在键盘上方正中央,很难够到!");return;}
		if(String_Belong(Que,"B")) {Slow("它在键盘下方正中央,很难够到!");return;}
		if(String_Belong(Que,"A")) {Slow("它正被你左手小指按着呢!");return;}
		if(String_Belong(Que,"S")) {Slow("它正被你左无名指按着呢!");return;}
		if(String_Belong(Que,"D")) {Slow("它正被你左手中指按着呢!");return;}
		if(String_Belong(Que,"F")) {Slow("它正被你左手食指按着呢!");return;}
		if(String_Belong(Que,"L")) {Slow("它正被你右无名指按着呢!");return;}
		if(String_Belong(Que,"K")) {Slow("它正被你右手中指按着呢!");return;}
		if(String_Belong(Que,"J")) {Slow("它正被你右手食指按着呢!");return;}
		if(String_Belong(Que,"Z")) {Slow("它在左手小指下面!");return;}
		if(String_Belong(Que,"X")) {Slow("它在左无名指右下方!");return;}
		if(String_Belong(Que,"C")) {Slow("它在左手食指左下方!");return;}
		if(String_Belong(Que,"V")) {Slow("它在左手食指右下方!");return;}
		if(String_Belong(Que,"N")) {Slow("它在右手食指左下方!");return;}
		if(String_Belong(Que,"M")) {Slow("它在右手食指右下方!");return;}
	}
}
struct Firework{float x,y,vx,vy;int color,life,t;}F[10000];int fr,fl;
void None_Firework(){fl=0;memset(F,0,sizeof(F));}
void Creat_Firework_U(int x0,int y0,int x1,int y1){
	int S=(x1-x0+1)*(y1-y0+1);
	int p=3;//密度 
	for(int i=x0;i<=x1;i++)for(int j=y0;j<=y1;j++) {fl++;F[fl].x=i+1,F[fl].y=j,F[fl].vx=-(rand()%26+5)/10.0,F[fl].vy=(rand()%41-20)/10.0;F[fl].color=10*(1+rand()%6);int r2=rand()%2;if(r2==1) F[fl].color++;F[fl].life=200;F[fl].t=10;}
	for(int i=1;i<=S*(p-1);i++) {int rx=rand()%(x1-x0+1)+x0,ry=rand()%(y1-y0+1)+y0;fl++;F[fl].x=rx,F[fl].y=ry,F[fl].vx=-(rand()%16+5)/5.0,F[fl].vy=(rand()%41-20)/10.0;F[fl].color=10*(1+rand()%6);int r2=rand()%4;if(r2==1) F[fl].color++;F[fl].life=200;F[fl].t=10;}
}
void Creat_Firework_O(int x,int y){
	int p=10;//密度 
	int g=360/p,v=(rand()%13+7)/5.0;
	for(int a=0;a<360;a+=g) {fl++;F[fl].x=x,F[fl].y=y,F[fl].vx=v*Sin(a),F[fl].vy=v*Cos(a);F[fl].color=10*(1+rand()%6+1);int r2=rand()%4;if(r2==1) F[fl].color++;F[fl].life=10;}
}
void Creat_Firework_R(int x,int y){fl++;F[fl].x=x,F[fl].y=y,F[fl].vx=(rand()%41-30)/15.0;F[fl].vy=(rand()%16+5)/5.0;F[fl].color=10*(1+rand()%6+1);int r2=rand()%4;if(r2==1) F[fl].color++;F[fl].life=20;}
void Go_Firework(){
	for(int i=fr;i<=fl;i++)
	{F[i].life--;F[i].t++;if(F[i].life<=0&&i==fr) fr++;Color(0);if(F[i].t<4) Color(-F[i].color);Setpos(F[i].x,F[i].y),printf("  ");if(F[i].t<3) Color(-F[i].color),Setpos(F[i].x+1,F[i].y),printf("  "),Setpos(F[i].x-1,F[i].y),printf("  "),Setpos(F[i].x,F[i].y+1),printf("  "),Setpos(F[i].x,F[i].y-1),printf("  ");}
	int up=1,down=38,left=1,right=45;
	float less=0.95,g=0.4;
	for(int i=fr;i<=fl;i++)
	{
    	F[i].vx+=g;F[i].x+=F[i].vx,F[i].y+=F[i].vy;
    	if(F[i].x<up) F[i].x=up,F[i].vx*=-less,F[i].life-=100;
		if(F[i].y<left) F[i].y=left,F[i].vy*=-less;
    	if(F[i].x>down) F[i].x=down,F[i].vx*=-less,F[i].life-=3;
		if(F[i].y>right) F[i].y=right,F[i].vy*=-less;
	}
	for(int i=fr;i<=fl;i++)
	{Setpos(F[i].x,F[i].y),Color(F[i].color);
	int r2=rand()%4,r3=rand()%5,r4=rand()%8;if(abs(F[i].color)>=20&&abs(F[i].color)<=39) r4=rand()%3;int r=rand()%3;if(r!=0&&r3!=0) Color(-F[i].color);
	if(r4==0) {printf("  ");continue;}if(r4==1) Color(50);
	if(r3==0) {if(r2==0) printf("◎");if(r2==1) printf("☆");if(r2==2) printf("◇");if(r2==3) printf("□");}
	else {if(r2==0) printf("●");if(r2==1) printf("★");if(r2==2) printf("◆");if(r2==3) printf("■");}
	}
}
void TEACH_Board_TEST(int a){//a==1:Left  2:Right  3:Mid  4: All
	Initialization_TYPPER();
	TYPPER_UP();
	if(a==1) Slow_Left(),Spark_Left();
	if(a==2) Slow_Right(),Spark_Right();
	if(a==3) Slow_Mid(),Spark_Mid();
	if(a==4) Slow_All(),Spark_All();
	Print_Hole_TYPPER_None();
	Slow_Frame(17,24,30,43);
	Setpos(19,27);
	if(a==4) Slow("欢迎你!挑战者!欢迎来到"),Setpos(20,27),Slow("“键盘背诵篇 之 最终考验”!!");else Slow("按下左侧显示的键!"),Sleep(200),Setpos(21,27),Slow("槽打满即可通关!");
	if(a==4) Setpos(22,26),Slow("(槽随时间自动流逝,越来越快!!)");else Setpos(22,27),Slow("(槽随时间自动流逝)");Sleep(500);
	Slow_Frame(17,2,23,21);
    memset(Q,0,sizeof(Q));int Que=0,Ft=0,Ti=0,Cleantime=5,t_last_clean,tstart,Tip[4];
	Right_Count=0;Rightmax=10;if(a==4) Rightmax=20;
    Print_Right_Count(20,8);
    while(Right_Count<Rightmax)
    {if(a==4&&Right_Count<=9) Cleantime=5;else if(a==4&&Right_Count<=16) Cleantime=4;else if(a==4) Cleantime=3; 
        Que++;
        if(a==1&&Que>=12) Que=0,memset(Q,0,sizeof(Q));
        if(a==2&&Que>=8) Que=0,memset(Q,0,sizeof(Q));
        if(a==3&&Que>=6) Que=0,memset(Q,0,sizeof(Q));
        if(a==4&&Que>=26) Que=0,memset(Q,0,sizeof(Q));
        Q1:char Que=rand()%26+'A';
        if(Q[Que-'A'+1]==1) goto Q1;
        if(a==1) if(T[N[Que-'A'+1]].left>4) goto Q1;//保证为前四列 
        if(a==2) if(T[N[Que-'A'+1]].left<7) goto Q1;//保证为后四列 
        if(a==3) if(T[N[Que-'A'+1]].left<=4||T[N[Que-'A'+1]].left>=7) goto Q1;//保证为中间两列 
		Q[Que-'A'+1]=1;
		memset(Tip,0,sizeof(Tip));Dark_Frame(23,25,29,42);
	Jump_Que(Que,20,3,-50);Print_Located_Key_Char(Que,20,3);Color(0);Setpos(19,3);cout<<"Quiz:";
    	tstart=clock();
    while(1)
    {
    	Ti=clock();
    if(Right_Count==0) t_last_clean=Ti;
        if((Ti-t_last_clean)/1000>=Cleantime&&Right_Count>0) Right_Count--,t_last_clean=clock(),Print_Right_Count(20,8); 
        if((Ti-tstart)/1000.0>=1.5&&Tip[1]==0) Tips(Que,1),Tip[1]=1; 
        if((Ti-tstart)/1000.0>=3.5&&Tip[2]==0) Tips(Que,2),Tip[2]=1; 
        if((Ti-tstart)/1000.0>=6&&Tip[3]==0) Tips(Que,3),Tip[3]=1; 
	Color(0);Setpos(19,14);cout<<"Left time:"<<Cleantime-(Ti-t_last_clean)/1000<<' ';
        if(Ft==1) Print_Frame_Line(-71);if(Ft>=1) Ft--;
        char Ans=0;
        if(kbhit()){Ans=_getch();if(Ans>='a'&&Ans<='z')Ans+='A'-'a';if(Ans<'A'||Ans>'Z')Ans=0;}
        if(Ans==Que)
        {
    Print_Located_Key_Char_C(Que,20,3,-20);
            Print_Frame_Line(-20);Ft=10;
            Spark_Key_Right(Ans,L26_Color[Ans-'A'+1],100);
            Print_Local_Key_C(Ans,'?',-70);
            Right_Count++;
            Print_Right_Count(20,8);
            break;
        }
        else if(Ans!=0) 
        {
            Print_Frame_Line(-40);Ft=10;
            Spark_Key_Wrong(Ans,L26_Color[Ans-'A'+1],100);
            Print_Local_Key_C(Ans,'?',-70);
            Print_Right_Count(20,8);
        }
    }
    }
    tstart=clock();int Fl=0;None_Firework();int Co=tstart;
    while(Ti-tstart<5000)
    {
    	Ti=clock();
    	if(Ti-tstart<2500&&Ti-tstart>1200&&Ti-Co>=200) {Co=Ti;Creat_Firework_O(3+rand()%3,5+rand()%35);}
    	if(Ti-tstart<1500) Creat_Firework_R(20,8+Rightmax);
    	else if(Fl==0) Creat_Firework_U(20,7,20,9+Rightmax),Fl=1;
    	Go_Firework();
    	Sleep(50);
	}
	Dark_Frame_L(0,0,39,45);
}
float Si[361],Co[361],Oven[361][3];
void Initialization_Image(){
	for(int i=0;i<=360;i++) Si[i]=Sin(i),Co[i]=Cos(i);
	for(int i=0;i<=360;i++) Oven[i][1]=Sin(i),Oven[i][2]=4*Cos(i);
}
int ArcTan(float xa,float ya,float xo,float yo){//输入真实数据即可
//作用:真实画面取tan 
//        90
//180--------------0
//        270
	float Xa=ya,Ya=-xa,Xo=yo,Yo=-xo;float Ax=Xa-Xo,Ay=Ya-Yo;
	if(Ay==0&&Ax==0) return 0;//默认方向:右 
	if(Ay==0&&Xa<Xo) return 180;if(Ay==0&&Xa>Xo) return 0;
	if(Ax==0&&Ya>Yo) return 90;if(Ax==0&&Ya<Yo) return 270;//直角坐标系:正常 
	float A=Ay/Ax,Ans;
 	for(int i=-89;i<=89;i++) {if(Tan(i)>=A) {Ans=i;break;}}
	if(Ans<0) Ans+=180;
	if(Ya>Yo) return Ans;//第一2象限 
	if(Ya<Yo) return Ans+180;//第34象限 
}
int Fdx=19,Fdy=25,Fr=10,Fmx=9,Fmy=12;//中心:10,13 
int FJ[19][25]={
{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0},
{0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0},
{0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0},
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,0},
{0,0,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,2,2,0,2,2},
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0},
{0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,2,0,0,0},
{1,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0},
{0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0},
{0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0},
{0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0},
{0,0,0,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0},
{0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0},
{0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0}
};
int FJ1[50][50],FJ2[50][50];
void Print_FJ(int midx,int midy){
	int sx=midx-Fmx+1,sy=midy-Fmy+1;memset(FJ1,0,sizeof(FJ1));memset(FJ2,0,sizeof(FJ2));
	for(int i=0;i<Fdx;i++)
	for(int j=0;j<Fdy;j++){
		int x=sx+i,y=sy+j;
		if(FJ[i][j]==1) Setpos(x,y),Color(-50),cout<<"  ",FJ1[x][y]=1;
		if(FJ[i][j]==2) Setpos(x,y),Color(-20),cout<<"  ",FJ1[x][y]=2;
	}
}
float Dis(float xa,float ya,float xo,float yo){return sqrt((xa-xo)*(xa-xo)+(ya-yo)*(ya-yo));}
int Spin_x(int angle,float xa,float ya,float xo,float yo){int a=ArcTan(xa,ya,xo,yo);a+=angle;int l=Dis(xa,ya,xo,yo);int Ax=Cos(a)*l,Ay=Sin(a)*l;return xo+Ax;}
int Spin_y(int angle,float xa,float ya,float xo,float yo){int a=ArcTan(xa,ya,xo,yo);a+=angle;int l=Dis(xa,ya,xo,yo);int Ax=Cos(a)*l,Ay=Sin(a)*l;return yo+Ay;}
char QA1[8][2][100]={
{{" 【 QWER 】区在键盘哪里?  "},{"      左上角      "}}, 
{{" 【 ZXCV 】区在键盘哪里?  "},{"      左下方      "}}, 
{{" 【 BNM 】区在键盘哪里?   "},{"     中下偏右     "}}, 
{{" 【 UIOP 】区在键盘哪里?  "},{"      右上角      "}}, 
{{" 【 JKL 】区在键盘哪里?   "},{"     中行右方     "}}, 
{{" 【 FGH 】区在键盘哪里?   "},{"       中央       "}}, 
{{" 【 ERTY 】区在键盘哪里?  "},{"     中上偏左     "}}, 
{{" 【 ASDF 】区在键盘哪里?  "},{"     中行左方     "}}
};
char QA2[9][2][100]={
{{"ERTY"},{"   左上方,后缀区   "}}, 
{{"UIOP"},{"   右上角,元音区   "}}, 
{{"ZXCV"},{"   左下方,Ctrl区   "}}, 
{{"ASDF"},{"  中行左方,左指正按  "}}, 
{{"AWSD"},{"  中行左方, AWSD 区  "}}, 
{{"QWER"},{"   左上角, QWER 区   "}}, 
{{"JKL*"},{"  中行右方,右指正按  "}}, 
{{"BNM*"},{"  中下偏右,右食指按  "}}, 
{{"FGHJ"},{"    中央,中继区    "}}, 
};
bool FJ_Ans,FJ_Q;
void FJ_question(int kind){
	if(kind==1){
		Qq:int q=rand()%8;if(Q[q]==1) goto Qq;Q[q]=1;
		FJ_Ans=rand()%2;
		Ww:int w=rand()%8;if (w==q) goto Ww;
		Setpos(9,7);cout<<QA1[q][0];
		Setpos(11,13);Color(FJ_Color['F'-'A'+1]);if(FJ_Ans==0) cout<<QA1[q][1];else cout<<QA1[w][1];
		Setpos(11,26);Color(FJ_Color['J'-'A'+1]);if(FJ_Ans==1) cout<<QA1[q][1];else cout<<QA1[w][1];
	}
	if(kind==2){
		Qq2:int q=rand()%9;if(Q[q]==1) goto Qq2;Q[q]=1;
		Aa:int r=rand()%4;char a=QA2[q][0][r];if(a=='*') goto Aa; 
		Ww2:int w=rand()%9;if(w==q) goto Ww2;if(String_Belong(a,QA2[w][0])==1) goto Ww2;
		FJ_Ans=rand()%2;
		Setpos(9,7);cout<<"   按键 【 "<<a<<" 】 属于:  ";
		Setpos(11,13);Color(FJ_Color['F'-'A'+1]);if(FJ_Ans==0) cout<<QA2[q][1];else cout<<QA2[w][1];
		Setpos(11,26);Color(FJ_Color['J'-'A'+1]);if(FJ_Ans==1) cout<<QA2[q][1];else cout<<QA2[w][1];
	}
}
void Creat_FJ(int midy,int up,int down){//19,22
	float midx=(up+down)*1.0/2;
	int angle=0,aa=58;float smallr=1;
	while(aa>0){
		if(smallr<=10) smallr+=1;
		
	float small=smallr*1.0/Fr;
	int sx=midx-Fmx+1,sy=midy-Fmy+1;
	for(int i=0;i<Fdx;i++)
	for(int j=0;j<Fdy;j++){
		if(FJ[i][j]==0)continue;
		int x=sx+i,y=sy+j;
		int xx=Spin_x(angle,x,y,sx+Fmx,sy+Fmy);
		int yy=Spin_y(angle,x,y,sx+Fmx,sy+Fmy);
		int Ax=xx-(Fmx+sx),Ay=yy-(Fmy+sy);
		float ax=Ax*small+(Fmx+sx),ay=Ay*small+(Fmy+sy);
		if(FJ[i][j]==1) FJ1[to(ax)][to(ay)]=1;
		if(FJ[i][j]==2) FJ1[to(ax)][to(ay)]=2;
	}
	for(int i=0;i<50;i++)for(int j=0;j<50;j++){
		if(FJ1[i][j]!=FJ2[i][j]){
		if(FJ1[i][j]==0||aa==1) Setpos(i,j),Color(0),cout<<"  ";
		else if(FJ1[i][j]==1) Setpos(i,j),Color(-50),cout<<"  ";
		else if(FJ1[i][j]==2) Setpos(i,j),Color(-20),cout<<"  ";
		}FJ2[i][j]=FJ1[i][j];
	}memset(FJ1,0,sizeof(FJ1));
	
		angle+=aa;aa--;if(aa<40) aa-=2;
		Sleep(20);
	}
    Print_FJ(midx,midy);Sleep(500);
    int Wall1=0,Wall2=46;
	while(Wall1<midy||Wall2>midy){
    	for(int i=up;i<=down;i++){
    		Setpos(i,Wall1);if(FJ1[i][Wall1]==0) Color(-50),cout<<"  ";else Color(0),cout<<"  ";
    		Setpos(i,Wall2);if(FJ1[i][Wall2]==0) Color(-20),cout<<"  ";else Color(0),cout<<"  ";
		}if(Wall1<midy) Wall1++;
		if(Wall2>midy) Wall2--;
		Sleep(5);
	}
}
void TEST_FJ(){Initialization_TYPPER();
	Creat_FJ(22,18,39);
	Dark_Frame_L(0,0,17,45);
	Slow_Frame(3,5,16,41);
	Setpos(5,7);Slow("准备!");Sleep(500); Slow("开始!");Sleep(500); Slow("答题!");Sleep(500); 
	Setpos(5,7);Slow_F("判断题型:按左手食指处“F”选择左边黄色选项,“J”选择右边绿色选项") ;
	Setpos(7,29);Slow("将能量槽打满即可通关!");
	Setpos(8,29);Slow("( 槽随时间自动流逝 )");Sleep(500);
		
	int f=N['F'-'A'+1],j=N['J'-'A'+1];T[f].y+=4;T[j].y-=3;FJ_Color['F'-'A'+1]=T9_Color[4];FJ_Color['J'-'A'+1]=T9_Color[6];
	
	Setpos(7,8);printf("Question:");
    memset(Q,0,sizeof(Q));int Que=0,Ft=0,Ti=0,Cleantime=10,t_last_clean,tstart,Tip[4];
	Right_Count=0;Rightmax=12;
    Print_Right_Count(13,7);
    while(Right_Count<Rightmax)
    {
        Que++;if(Right_Count<=4) FJ_question(1);else FJ_question(2);
        if(Que>=7) Que=0,memset(Q,0,sizeof(Q));
        
    	tstart=clock();
    while(1)
    {
    	Ti=clock();
    if(Right_Count==0) t_last_clean=Ti;
        if((Ti-t_last_clean)/1000>=Cleantime&&Right_Count>0) Right_Count--,t_last_clean=clock(),Print_Right_Count(13,7);
	Color(0);Setpos(13,23);cout<<"Left time:"<<Cleantime-(Ti-t_last_clean)/1000<<' ';
        if(Ft==1) Print_Frame_Line_FJ(-71);if(Ft>=1) Ft--;
        char Ans=0;
        if(kbhit()){Ans=_getch();if(Ans=='f'||Ans=='F')Ans=1;else if(Ans=='j'||Ans=='J')Ans=2;else Ans=0;}
        if(Ans==FJ_Ans+1)
        {if(Ans==1) Ans='F';if(Ans==2) Ans='J';
            Print_Frame_Line_FJ(-20);Ft=10;
            Spark_Key_Right(Ans,FJ_Color[Ans-'A'+1],100);
            Print_Local_Key_C(Ans,Ans,-70);
            Right_Count++;
            Print_Right_Count(13,7);
            break;
        }
        else if(Ans!=0) 
        {if(Ans==1) Ans='F';if(Ans==2) Ans='J';
            Print_Frame_Line_FJ(-40);Ft=10;
            Spark_Key_Wrong(Ans,FJ_Color[Ans-'A'+1],100);
            Print_Local_Key_C(Ans,Ans,-70);
            if(Right_Count>0) Right_Count--; 
            Print_Right_Count(13,7);
        }
    }
    }
    tstart=clock();int Fl=0;None_Firework();
    while(Ti-tstart<5000)
    {
    	Ti=clock();
    	if(Ti-tstart<1500) Creat_Firework_R(13,7+Rightmax);
    	else if(Fl==0) Creat_Firework_U(13,7,13,9+Rightmax),Fl=1;
    	Go_Firework();
    	Sleep(50);
	}
	Dark_Frame_L(0,0,39,45);
}

struct TYPE_WORD{
    char C_name[1000],E_name[1000];//e:拼音 
    int C_last,E_last;//-----------E_name,从零开始! 
    int to_be_write;//-----------从零开始! 
    int writing;//是否正在输入 
    int error;//是否已经输错 
}W[1000];
int Word_num;int Start_x=5,Start_y=5,Start_Gap=3;
void Creat_Word(char c[500],char e[500],int i){for(int j=0;j<500;j++){W[i].C_name[j]=c[j];if(c[j]==0&&W[i].C_last==0) {W[i].C_last=j-1;}if(e[j]==0&&W[i].E_last==0) {W[i].E_last=j-1;}else W[i].E_name[j]=e[j];}W[i].to_be_write=W[i].writing=W[i].error=0;}
void Print_Single_Word(int i){int where=i,x,y;y=Start_y;x=Start_x+(where-1)*Start_Gap;if(W[i].error==0) Color(-20); else Color(-70); Setpos(x-1,y);int Long_Word=0;if(W[i].E_last>=20) Long_Word=1;int S=0,E=W[i].E_last;if(Long_Word==1) S=max(S,W[i].to_be_write-5),E=min(S+20,W[i].E_last);for(int j=S;j<=E;j++){if(j>=W[i].to_be_write||W[i].writing==0) Color(0);if(W[i].writing==1) printf("%c",W[i].E_name[j]);else printf(" ");}Color(0);printf(" ");Setpos(x,y);cout<<W[i].C_name;}
void Print_Empty_Word(int i){int where=i,x,y;y=Start_y;x=Start_x+(where-1)*Start_Gap;Color(0); Setpos(x-1,y);cout<<"                             ";Setpos(x,y);for(int j=0;j<=W[i].C_last;j++) cout<<" ";}
void Delete_Single_Word(int i){memset(W[i].C_name,0,sizeof(W[i].C_name));memset(W[i].E_name,0,sizeof(W[i].E_name));W[i].E_last=W[i].C_last=W[i].to_be_write=W[i].writing=W[i].error=0;}
void Delete_All_Word(){for(int i=1;i<=Word_num;i++) Print_Empty_Word(i),Delete_Single_Word(i);Word_num=0;}
void Print_Gold_Word(int i){int where=i,x,y;y=Start_y;x=Start_x+(where-1)*Start_Gap;Color(-50); Setpos(x-1,y);int Long_Word=0;if(W[i].E_last>=20) Long_Word=1;int S=0,E=W[i].E_last;if(Long_Word==1) S=max(S,W[i].to_be_write-5),E=min(S+20,W[i].E_last);for(int j=S;j<=E;j++){printf("%c",W[i].E_name[j]);}Color(0);printf(" ");Setpos(x,y);cout<<W[i].C_name;Sleep(100);}
void Print_All_Word(){for(int i=1;i<=Word_num;i++) Print_Single_Word(i);}
void Slow_Print_All_Word(){for(int i=1;i<=Word_num;i++) {Print_Single_Word(i);if(Word_num<=3) Sleep(700);else Sleep(50);}}
void Add_Word_Letter(char c[200],char e[200],int i){int l=W[i].E_last,lc=W[i].C_last;bool eend=0,endc=0;
for(int j=0;j<200;j++){lc++;W[i].C_name[lc]=c[j];if(c[j]==0&&endc==0) {W[i].C_last=lc-1;endc=1;}}
for(int j=0;j<200;j++){l++;W[i].E_name[l]=e[j];if(e[j]==0&&eend==0) {W[i].E_last=l-1;eend=1;if(W[i].E_last>=20) Print_Empty_Word(i);}}Print_Single_Word(i);}
int Choose;
void Word_Skill(int a){Choose=a;}
void Delete_Read_Board(){for(int i=1;i<=Word_num;i++){W[i].to_be_write=W[i].writing=W[i].error=0;}}
void Delete_Error(){for(int i=1;i<=Word_num;i++){W[i].writing=1;W[i].error=0;}}
bool Check_All_Error(){bool error;for(int i=1;i<=Word_num;i++){if(W[i].error==0) return 0;}return 1;}
void Check_Letter(char a){
    if(Check_All_Error()) return;
    for(int i=1;i<=Word_num;i++){
        if(W[i].error==0&&W[i].E_name[W[i].to_be_write]==a){
            if(W[i].to_be_write==W[i].E_last){
                Print_Gold_Word(i);
                Word_Skill(i);
                Delete_Read_Board();
            }
            else W[i].to_be_write++,W[i].writing=1;
        }
        else if(W[i].error==0&&W[i].to_be_write!=0&&W[i].E_name[W[i].to_be_write]!=a) W[i].error=1;
    }
}
void Word_Reader(){Print_All_Word();
    while(Choose==0)
    {
        char Ans=0;
        if(kbhit()){
            if(KEY_DOWN(8))
			{
				if(Check_All_Error()) Delete_Error();
				else Delete_Read_Board();
			}
            else {char Ans=_getch();
            if(Ans>='A'&&Ans<='Z') Ans=Ans-'A'+'a';
            if(Ans>='a'&&Ans<='z') Check_Letter(Ans);
            }
        Print_All_Word();
        }
    } 
}
void Add_Level_Word(int level){
if(level==4){
	int r=rand()%9;
	if(r==0) Add_Word_Letter("ai ","ai",1);
	if(r==1) Add_Word_Letter("ei ","ei",1);
	if(r==2) Add_Word_Letter("ao ","ao",1);
	if(r==3) Add_Word_Letter("ou ","ou",1);
	if(r==4) Add_Word_Letter("ia ","ia",1);
	if(r==5) Add_Word_Letter("ie ","ie",1);
	if(r==6) Add_Word_Letter("ua ","ua",1);
	if(r==7) Add_Word_Letter("uo ","uo",1);
	if(r==8) Add_Word_Letter("ue ","ue",1);
}
if(level==6){
	int r=rand()%4;
	if(r==0) Add_Word_Letter("iao ","iao",1);
	if(r==1) Add_Word_Letter("iou ","iou",1);
	if(r==2) Add_Word_Letter("uai ","uai",1);
	if(r==3) Add_Word_Letter("uei ","uei",1);
}
if(level==8){
	int r=rand()%15;
	if(r==0) Add_Word_Letter("an ","an",1);
	if(r==1) Add_Word_Letter("ian ","ian",1);
	if(r==2) Add_Word_Letter("uan ","uan",1);
	if(r==3) Add_Word_Letter("ang ","ang",1);
	if(r==4) Add_Word_Letter("en ","en",1);
	if(r==5) Add_Word_Letter("eng ","eng",1);
	if(r==6) Add_Word_Letter("in ","in",1);
	if(r==7) Add_Word_Letter("ing ","ing",1);
	if(r==8) Add_Word_Letter("un ","un",1);
	if(r==9) Add_Word_Letter("ung ","ung",1);
	if(r==10) Add_Word_Letter("iang ","iang",1);
	if(r==11) Add_Word_Letter("uang ","uang",1);
	if(r==12) Add_Word_Letter("ueng ","ueng",1);
	if(r==13) Add_Word_Letter("ong ","ong",1);
	if(r==14) Add_Word_Letter("iong ","iong",1);
}
}
void Shinning(){
    for(int i=0;i<=8;i++)
    {
        system("color 1A");Sleep(10);
        system("color 2B");Sleep(10);
        system("color 3C");Sleep(10);
        system("color 4D");Sleep(10);
        system("color 5D");Sleep(10);
        system("color 6E");Sleep(10);
        system("color 7F");Sleep(10);
    }system("color 0F");system("cls");
}
void Start_Level(int level){
#define DCS Delete_All_Word();Choose=0;Setpos(13,3);if(level>0) cout<<"Level "<<level<<" : "
//if(level<=3) Choose=1;
if(level==0) {DCS;
Start_x=16;Start_y=5;Start_Gap=2;Word_num=12;
Creat_Word("开始  \t\t(一遍拉完所有教程,若为初学者,请输入 k a i s h i )","kaishi",1);
Creat_Word("键盘识记\t\t(附练习)","jian",2);
Creat_Word("  无练习版","wu",3);
Creat_Word("识记测试\t\t【复习推荐】(全键盘)","shiji",4);
Creat_Word("短句练习\t\t【精髓,复习尤为推荐】(附韵母练习,困难,内可跳关)","duan",5);
Creat_Word("  教程(左手)","jiaochengzuo",6);
Creat_Word("  教程(右手)","jiaochengyou",7);
Creat_Word("  教程(中央)","jiaochengzhong",8);
Creat_Word("  测试(判断题)","ceshipan",9);
Creat_Word("  测试(左手)","ceshizuo",10);
Creat_Word("  测试(右手)","ceshiyou",11);
Creat_Word("  测试(中央)","ceshizhong",12);
}
	if(level==1) {DCS;cout<<"初试手 (记住输 PASS 可跳关哦)   ";Start_x=17;Start_y=5;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("试试输入我","shishishuruwo",1);}
	if(level==2) {DCS;cout<<"韵母篇 1 - 单元音  ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("a o e i u ü(v) (输三遍)","aoeiuvaoeiuvaoeiuv",1);}
	if(level==3) {DCS;cout<<"韵母篇 2 - 复韵母(上)  ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("ai ei ao ou ia ie ua uo ue (每个输三遍)","aiaiaieieieiaoaoaoouououiaiaiaieieieuauauauouououeueue",1);}
	if(level==4) {DCS;cout<<"韵母篇 2 - 复韵母(上)"<<endl<<"      【小巩固:词条随机出字母,加快输入追上词条!限时游戏,词条过长将重新开始挑战!】";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("","",1);for(int i=1;i<=5;i++) Add_Level_Word(level);}
	if(level==5) {DCS;cout<<"韵母篇 2 - 复韵母(下)"<<endl<<"                                                                                      ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("iao iou uai uei(每个输三遍)","iaoiaoiaoiouiouiouuaiuaiuaiueiueiuei",1);}
	if(level==6) {DCS;cout<<"韵母篇 2 - 复韵母(下)"<<endl<<"      【小巩固:词条随机出字母,加快输入追上词条!限时游戏,词条过长将重新开始挑战!】";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("","",1);for(int i=1;i<=4;i++) Add_Level_Word(level);} 
	if(level==7) {DCS;cout<<"韵母篇 3 - 鼻韵母 "<<endl<<"                                                                                          ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("an ian uan ang en eng in ing un uen iang uang ueng ong iong(每个输一遍就好!)","anianuanangenenginingunuenianguanguengongiong",1);}
	if(level==8) {DCS;cout<<"韵母篇 3 - 鼻韵母 "<<endl<<"      【小巩固:词条随机出字母,加快输入追上词条!限时游戏,词条过长将重新开始挑战!】";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("","",1);for(int i=1;i<=4;i++) Add_Level_Word(level);}
	if(level==9) {DCS;cout<<"打一波字母表吧!"<<endl<<"                                                                                          ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("","",1);char aa[3],bb[3];for(int i=1;i<=26;i++) aa[0]='a'-1+i,bb[0]='A'-1+i,Add_Word_Letter(bb,aa,1);}
	if(level==10) {DCS;cout<<"再打几句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("Thanks to use Blind TYPPER","thankstouseblindtypper",1);}
	if(level==11) {DCS;cout<<"再打 10 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("作者:TSzza","zuozhetszza",1);}
	if(level==12) {DCS;cout<<"再打 9 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("鸣谢:炫哥,唐朝,Sam,怪兽","mingxiexuangetangchaosamguaishou",1);}
	if(level==13) {DCS;cout<<"再打 8 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("在结束之前,作者还有几句话要讲:","zaijieshuzhiqianzuozhehaiyoujijuhuayaojiang",1);}
	if(level==14) {DCS;cout<<"再打 7 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("盲打靠的不是一时的训练,更是持久的巩固","mangdakaodebushiyishidexunliangengshichijiudegonggu",1);}
	if(level==15) {DCS;cout<<"再打 6 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("在平时打字时,下意识不看键盘,保持手型,才能使现在的努力不白费","zaipingshidazishixiayishibukanjianpanbaochishouxingcainengshixianzaidenulibubaifei",1);}
	if(level==16) {DCS;cout<<"再打 5 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("非常高兴你能闯关到这里,希望在未来,你可以时不时打开这程序再次进行巩固","feichanggaoxingninengchuangguandaozhelixiwangzaiweilainikeyishibushidakaizhechengxuzaicijinxinggonggu",1);}
	if(level==17) {DCS;cout<<"再打 4 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("程序的版本可能还会更新,获取最新版本网址:luogu.com.cn/blog/z1e2k3i4/","chengxudebanbenkenenghaihuigengxinhuoquzuixinbanbenwangzhiluogucomcnblogzeki",1);}
	if(level==18) {DCS;cout<<"再打 3 句话!我们就进最终词条!     ";Start_x=17;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("...","",1);Print_All_Word();Sleep(1000);Choose=1;}
	if(level==19) {DCS;cout<<"再打 2 句话!我们就进最终词条!     ";Start_x=17;Start_y=2;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("终于,终于要来到了吗,那个伟大的瞬间,程序将完成它的使命,你将出师,迈出新世界的大门!","zhongyuzhongyuyaolaidaolemanageweidadeshunjianchengxujiangwanchengtadeshimingnijiangchushimaichuxinshijiededamen",1);}
	if(level==20) {DCS;cout<<"再打 1 句话!我们就进最终词条!     ";Start_x=17;Start_y=5;Start_Gap=5;Word_num=2;Creat_Word("","pass",2);Creat_Word("来吧,来吧,你准备好了吗?最终词条,准备吧!出师吧!","laibalaibanizhunbeihaolemazuizhongcitiaozhunbeibachushiba",1);}
	if(level==21) {DCS;cout<<"最终词条来了!!                   ";Start_x=17;Word_num=1;system("color 6E");Sleep(100);system("color 0F");Creat_Word("我,准备好了,结束吧!!","wozhunbeihaolejieshuba",1);}
}
void Go_Level_Word(int level){
	Start_Level(level);Slow_Print_All_Word();
int T,t_last_add;float Speed;
	if(level==4) Speed=1.1;
	else Speed=1.25;
t_last_add=clock();
    while(Choose==0)
    {
    	T=clock();
if(level==4||level==6||level==8) {if(((T-t_last_add)/1000>=Speed)&&W[1].error==0) t_last_add=clock(),Add_Level_Word(level);if(W[1].E_last>=50) {W[1].error=1;Sleep(500);Print_Empty_Word(1);Start_Level(level);}}
        char Ans=0;
        if(kbhit()){
            if(KEY_DOWN(8)) {Print_Empty_Word(1);Start_Level(level);}
            else {char Ans=_getch();
            if(Ans>='A'&&Ans<='Z') Ans=Ans-'A'+'a';
            if(Ans>='a'&&Ans<='z') Check_Letter(Ans);
            }
        Print_All_Word();
        }
    } 
}
void TEACH_Board_Word(){Initialization_TYPPER();//Ang  +   Sentense
	Slow_Frame(1,1,11,33);
	Setpos(3,3);Slow("好!好!好!!接下来就简单多了!");Sleep(500);
	Setpos(5,3);Slow("只要再把常用韵母什么的练一下,教程就结束了!");Sleep(500);
	Setpos(7,3);Slow("加油!接下来就没有测试了!");Sleep(500);
	Setpos(9,3);Slow("打通下面关卡,我们就出师!!");Sleep(1000);
	Dark_Frame(2,2,10,32);
	Setpos(3,3);Slow("规则讲解:");Sleep(500);
	Setpos(5,3);Slow("1、输入词条对应全拼小写字母即可通关");Sleep(500);
	Setpos(7,3);Slow("2、若中途输入错误,词条会闪灰色,此时只能通过【Backspace】");
	Setpos(9,3);Slow("  来清除全文,重新开始输入!【另:输入 [ PASS ] 可以跳关】");Sleep(500);
	for(int i=1;i<=21;i++){Go_Level_Word(i);} 
}
void TYPPER_UP(){
	UP=38;int Ti=0;
	for(int i=1;i<=26;i++){T[i].x+=36;}
	while(UP>2)
	{Ti++;
		Print_Frame();
		Print_Hole_TYPPER_Key();
		if(UP+14<39) Dark_Frame(UP+14,0,42,39);
		UP-=3;
		for(int i=1;i<=26;i++){T[i].x-=3;}
		Sleep(10);
	}
	Color(0);system("cls");
	Initialization_TYPPER();
	Print_Hole_TYPPER();
}
char *str;char stt[100];
void Start_Push_Sentence(int xx)
{
    char ans,Ans=0;
	for(int i=0;i<strlen(str);i++) stt[i]=str[i];
	int ss=0;
	for(int i=0;i<strlen(str);i++)
    {
    	if(Ans!=0) Print_Local_Key_C(Ans,Ans,-70);
        ans=stt[ss],Ans=0;
    	Color(0);Setpos(xx,3+i*0.5);cout<<ans;
        if(ans>='a'&&ans<='z') Ans=ans-'a'+'A';else if(ans>='A'&&ans<='Z') Ans=ans;
    	if(Ans!=0) Print_Single_Key_Char_C(Ans,-71);
		Sleep(5);
		ss++;
    }
}
char Bli[1000][1000]={
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
{0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,0,0,0,0,1,0,0,0,1,0,1,1,1,0,0,0,1,1,1,0,0},
{0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0},
{0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,1,1,0,1,0,0,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,1,1,1,0,1,1},
{0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,2,2,2,2,2,0,0,2,2,2,2,0,0,0,2,2,2,2,2,2,0,0,0,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,0,0,0},
{0,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,2,2,2,0,0,2,2,2,0,2,2,2,0,0,2,2,2,0,2,2,2,0,0,2,2,2,0,0,0},
{0,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,0,0,0,0,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,0,0,0,2,2,2,2,2,2,2,0,0,0,0},
{0,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,0,0,0,0,2,2,2,2,0,0,0,0,0,0,2,2,2,2,2,2,2,0,2,2,2,2,0,0,2,2,2,0,0}
};
void Start(){Initialization_TYPPER();
	
	for(int i=1;i<=26;i++){T[i].x+=24;}
	UP=26;
	Print_Hole_TYPPER();
int Bc=5,Tc=3,Zc=1;
for(int i=0;i<=20;i++) 
for(int j=1;j<=90;j++){
	Setpos(i+2,(j+3)*0.5);
	if(Bli[i][j]==1) Color(L8_Color[Bc%8+1]),cout<<' ';
	if(Bli[i][j]==2) Color(L8_Color[Tc%8+1]),cout<<' ';
}Setpos(16,31);Color(-50);cout<<" 1.0 "; 
str="BlindTYPER";
for(int i=0;i<strlen(str);i++) stt[i]=str[i];
int ss=0,Turn=0;
	while(1)
    {
        char ans=stt[ss],Ans;int sx;
        if(ans>='a'&&ans<='z') Ans=ans-'a'+'A';else Ans=ans;
        sx=2+4*ss;if(ss>=5) sx+=2;
    Print_Single_Key_Char_C(Ans,L8_Color[Turn%8+1]);
	Jump_Que_F(ans,22,sx,L8_Color[Turn%8+1]);
    Print_Local_Key_C(Ans,Ans,-70);
	ss++;ss%=10;
	if(ss==0)
	{
		Sleep(700),Turn++;Bc++,Tc++,Zc++;
for(int i=0;i<=20;i++) 
for(int j=1;j<=90;j++){
	Setpos(i+2,(j+3)*0.5);
	if(Bli[i][j]==1) Color(L8_Color[Bc%8+1]),cout<<' ';
	if(Bli[i][j]==2) Color(L8_Color[Tc%8+1]),cout<<' ';
	Setpos(18,33);cout<<"        作者:TSzza "; 
	Setpos(19,33);Color(L8_Color[Zc%8+1]); cout<<"    按任意键开始    ";
} 
	}
		if(kbhit()) {char a=_getch();break;}
    }
	Color(0);
}
int main()
{
    srand((unsigned)time(NULL));
    system("mode con cols=92 lines=41");
    CONSOLE_CURSOR_INFO cursor_info={1,0};
    SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
    Start();
STA:system("cls");
    Initialization_TYPPER();//初始化
//    Print_Hole_TYPPER();
	Frame(1,1,13,33);
	Setpos(3,3);Slow_F("【 目录 】 特殊 词条选择规则讲解:(按任意键快进)");
	Setpos(5,3);Slow_F("1、输入词条对应全拼小写字母即可选择【有几个选项只需输首字】");Sleep(500);
	Setpos(7,3);Slow_F("2、若中途输入错误,词条会闪灰色,此时只能通过【Backspace】");
	Setpos(9,3);Slow_F("  来清除全文,重新开始输入!");Sleep(500);
	Setpos(11,3);Slow_F("3、不适用拼音输入法(Ctrl + 空格 即可切换)");Sleep(500);
Go_Level_Word(0);system("color 6E");Sleep(50);system("color 0F");system("cls");
if(Choose==1){
	TEACH_Board_Remember();
	TEST_FJ();
	TEACH_Board_Left();
	TEACH_Board_TEST(1);
	TEACH_Board_Right();
	TEACH_Board_TEST(2);
	TEACH_Board_Mid();
	TEACH_Board_TEST(3);
	TEACH_Board_TEST(4);
	TEACH_Board_Word();
}
if(Choose==2){
	TEACH_Board_Remember();
	TEST_FJ();
	TEACH_Board_Left();
	TEACH_Board_TEST(1);
	TEACH_Board_Right();
	TEACH_Board_TEST(2);
	TEACH_Board_Mid();
	TEACH_Board_TEST(3);
	TEACH_Board_TEST(4);
}
if(Choose==3){
	TEACH_Board_Remember();
	TEACH_Board_Left();system("cls");
	TEACH_Board_Right();system("cls");
	TEACH_Board_Mid();
}
if(Choose==4) TEACH_Board_TEST(4);
if(Choose==5) TEACH_Board_Word();
if(Choose==6) TEACH_Board_Left();
if(Choose==7) TEACH_Board_Right();
if(Choose==8) TEACH_Board_Mid();
if(Choose==9) TEST_FJ();
if(Choose==10) TEACH_Board_TEST(1);
if(Choose==11) TEACH_Board_TEST(2);
if(Choose==12) TEACH_Board_TEST(3);
	Shinning();
goto STA;
Sleep(50000);
    return 0;
}

五、忍者必须胎

#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<time.h>
#define Nor if(B[b].x<5) B[b].x=5;
#define Out1 Bx1-Bvx1<=6||Bx1-Bvx1>=28||By1-Bvy1<=7||By1-Bvy1>=27
#define Out2 Bx2-Bvx2<=6||Bx2-Bvx2>=28||By2-Bvy2<=7||By2-Bvy2>=27
#define Chang1 {Bwhat1=0;Bvx1=Bvy1=0;memset(Bgo1,0,sizeof(Bgo1));}
#define Chang2 {Bwhat2=0;Bvx2=Bvy2=0;memset(Bgo2,0,sizeof(Bgo2));}
#define Chang3 {Bwhat3=0;Bvx3=Bvy3=0;memset(Bgo3,0,sizeof(Bgo3));}
using namespace std;
int ti(float a) {return ((int)(a*10+5))/10;}
void Setpos(float x,float y){COORD pos;pos.X=ti(y*4)/2;pos.Y=ti(x);SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}
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);if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED);if(a==9) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_GREEN|BACKGROUND_BLUE);if(a==10) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_BLUE);if(a==11) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_BLUE);if(a==12) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);if(a==13) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY);if(a==14) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN|FOREGROUND_BLUE);}
int Blomax,Ren,Exp,Expmax,Lv,Lvl,Ice,Drug,ar1,ar2,Tar1,Tar2,bl,br,Win,T,Tb,Sy,Up,Upt,Down,u1,u2,Kill,Killb,L,Ll[4],Li,D,Gd[10],Biao,Fire,Fir,fir[4],Water,Thun,Wind,Magne,I[20][2],ib,Dis,Disb,Dis1,Disb1,Boss,Bblo,Bblomax,Bwhat1,Bwhat2,Bwhat3,Bgo1[10],Bgo2[10],Bgo3[10],Bbr,Bbl,Bl[4];
float X,Y,Vx,Vy,Ding,Blo,Hui,Bx1,By1,Bx2,By2,Bx3,By3,Bvx1,Bvy1,Bvx2,Bvy2,Bvx3,Bvy3,Bway[1001][2];
struct bullet{float x,y,vx,vy;int what;int a,t,How;int life;bool kill;}B[100001];
void Map(int a,int b);
void Pan(int a,float x,float y,int b){
    float Nox[4],Noy[4];Nox[0]=X,Noy[0]=Y;
    if(Down==1&&X==22) Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=X-1,Noy[2]=Y-0.5;else if(Down==2) Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=-10,Noy[2]=-10;else if(Down==1||X<18) Nox[1]=X-1,Noy[1]=Y-0.5,Nox[2]=-10,Noy[2]=-10;else Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=X-1,Noy[2]=Y-0.5;
    for(int i=0;i<3;i++){
        if(a==-1){if(abs(x-Nox[i])+abs(y-Noy[i])<1.5) {if(B[b].what==-10)Exp+=2;if(B[b].what==-11)Exp+=1;B[b].life=0;if(B[b].life==0&&b==bl) bl++;Map(3,b);break;}}
        if(a==-2){if(abs(x-Nox[i])+abs(y-Noy[i])<2.5) {if(B[b].what==-2)Exp+=5,Biao+=5;if(B[b].what==-3)Fire=300,Ice=0,Fir=3;if(B[b].what==-4)Water=200;if(B[b].what==-5){Wind=70;Ding=28.25;Ice=0;if(Y<Ding-1)Vy=5;else Vy=0;if(Up>=1) Vx=-5;if(Down==2) Vx=5;}if(B[b].what==-6){Thun=200;system("color 1F");Sleep(20);system("color 6F");Sleep(10);system("color 0F");}if(B[b].what==-7)Magne=300;if(B[b].what==-8)Ice=0,Drug=0,Blo=fmin((float)Blomax,Blo+20);if(B[b].what==-9)Exp=fmin((float)Expmax,Exp+20);B[b].life=0;if(B[b].life==0&&b==bl) bl++;Map(3,b);break;}}
    }if(Wind==0&&Thun==0&&(B[b].kill!=0||Killb>=15||Ren==1&&Killb>0)) return;
    for(int i=0;i<3;i++){
        if((Wind>=1||Thun>=1)&&abs(x-Nox[i])+abs(y-Noy[i])<2.5) {if(B[b].what<98)Exp+=2;B[b].life=0;Map(3,b);break;}
        if(a==1) {if(abs(x-Nox[i])<0.5&&abs(y-Noy[i])<1) {if(B[b].what>=99)Blo-=10;if(B[b].what==14)Blo-=15,Ice=100,B[b].life=0;else if(B[b].what==15)Blo-=20,Ice=0,B[b].life=0;else if(B[b].what==17)Blo-=5,Drug=100,B[b].life=0;else if(B[b].what>=13&&B[b].what<=17)Blo-=10,B[b].life=0;else Blo-=15;B[b].kill=1,Killb=20;Kill=1;Map(3,b);break;}}
        if(a==2||a==6||a==8||a==9||a==10||a==11||a==12) {if(abs(x-Nox[i])+abs(y-Noy[i])<1.5) {if(a==2)Blo-=20;else if(a==8)Blo-=10;else Blo-=15;B[b].kill=1,Killb=20;Kill=1;if(a!=2){B[b].life=0;if(B[b].life==0&&b==bl) bl++;Map(3,b);break;}}}
        if(a==4) {if((Wind>=1||Thun>=1)&&abs(x-Nox[i])<1.5&&Noy[i]-y<=0&&Noy[i]-y>=-8) {if(B[b].what<98)Exp+=2;B[b].life=0;Map(3,b);break;}if(abs(x-Nox[i])<1&&Noy[i]-y<=0&&Noy[i]-y>=-8) {Blo-=25,B[b].kill=1,Killb=20;Kill=1;Vy=-1;Y-=0.5;break;}}
    }
}
void Map(int a,int b){
    Color(0);
    if(a==-1){
        if(Boss==1||Boss==6){if(Bwhat1==5){if(ti(Bx1)==20)Setpos(Bx1,By1),cout<<"==";else Setpos(Bx1,By1),cout<<"  ";}else{Setpos(Bx1-1,By1-0.5),cout<<"    ";Setpos(Bx1,By1-1),cout<<"      ";Setpos(Bx1+1,By1-0.5),cout<<"    ";if(abs(ti(Bx1)-20)<=1)Setpos(20,By1-1),cout<<"======";}}
        if(Boss==2||Boss==6){Setpos(Bx2-1,By2-1);cout<<"    ";Setpos(Bx2,By2-1);cout<<"      ";Setpos(Bx2+1,By2-1),cout<<"      ";Color(0);if(abs(ti(Bx2)-20)<=1)Setpos(20,By2-1),cout<<"======";}
        if(Boss==3||Boss==6){Setpos(Bx3-1,By3-0.5);cout<<"     ";Setpos(Bx3,By3);cout<<"  ";Setpos(Bx3+1,By3-1),cout<<"      ";Color(0);if(abs(ti(Bx3)-20)<=1)Setpos(20,By3-1),cout<<"=======";}
        if(X<0)return;if(X>=17&&X<=19){Setpos(X-1,Y);cout<<"  ";Setpos(X,Y-1);cout<<"   ";Setpos(X+1,Y-1),cout<<"   ";}else if(X<=23&&X>=21){Setpos(X+1,Y);cout<<"  ";Setpos(X,Y-1);cout<<"   ";Setpos(X-1,Y-1),cout<<"    ";}else if(X>23){Setpos(X,Y-1);cout<<"    ";Setpos(X-1,Y-0.5),cout<<"   ";}else if(X<17&&Upt!=0){Setpos(X,Y-1);cout<<"    ";Setpos(X+1,Y-1.5),cout<<"    ";}else if(X<17){Setpos(X,Y-1);cout<<"    ";Setpos(X+1,Y-0.5),cout<<"   ";}if(Thun>0){Setpos(X-2,Y-1),cout<<"    ";Setpos(X+2,Y-1),cout<<"    ";Setpos(X,Y+2),cout<<"  ";Setpos(X,Y-2.5),cout<<"  ";Setpos(X-1,Y+1),cout<<"  ";Setpos(X+1,Y+1),cout<<"  ";Setpos(X-1,Y-2),cout<<"  ";Setpos(X+1,Y-2),cout<<"  ";Setpos(20,Y-2.5),cout<<"============";}if(Wind!=0){Setpos(X+1,Y-5);cout<<"        ";Setpos(X,Y-5);cout<<"        ";Setpos(X-1,Y-5);cout<<"        ";Setpos(20,Y-5),cout<<"========";}if(Water!=0){Setpos(X,Y-4);cout<<"       ";Setpos(X+2,Y-3.5);cout<<"     ";Setpos(X-2,Y-3.5);cout<<"     ";Setpos(X+1,Y-3.5);cout<<"     ";Setpos(X-1,Y-3.5);cout<<"     ";Setpos(20,Y-5),cout<<"========";}if(Fire!=0){Setpos(X,Y+1),cout<<"  ";Setpos(X+1,Y),cout<<"  ";Setpos(X-1,Y-1),cout<<"  ";Setpos(20,Y-1);cout<<"======";}
    }
    if(a==0){
        if(Boss==1||Boss==6){if(Bwhat1==5)Color(5),Setpos(Bx1,By1),cout<<"█",Color(0);else if(Bwhat1==4&&Bgo1[1]>6&&Bgo1[1]<11)Color(4),Setpos(Bgo1[5]-1,Bgo1[6]),cout<<"︻",Setpos(Bgo1[5],Bgo1[6]-1),cout<<"【",Setpos(Bgo1[5],Bgo1[6]+1),cout<<"】",Setpos(Bgo1[5]+1,Bgo1[6]),cout<<"︼",Color(0);else{Setpos(Bx1-1,By1-0.5),Color(0),cout<<"●●";Setpos(Bx1,By1-1);if(Bwhat1==2&&Bgo1[1]<=5)Color(1);else if(Bwhat1==3&&Bgo1[1]<=5)Color(5);else if(Bwhat1==6&&Bgo1[1]<=5)Color(8); else Color(4);if(Bwhat1==4) Setpos(Bx1,By1-0.5),cout<<"██(";else cout<<")██(";Setpos(Bx1+1,By1-0.5),cout<<"……";Color(0);}}
        if(Boss==2||Boss==6){Setpos(Bx2-1,By2-1);Color(0),cout<<"\\ ";Color(0);cout<<"●";Setpos(Bx2,By2-1);Color(3);cout<<"◥";Color(5),cout<<"JJJ";Color(0),cout<<">";Color(3);Setpos(Bx2+1,By2-1),cout<<"◢█◣";Color(0);}
        if(Boss==3||Boss==6){Setpos(Bx3-1,By3-0.5);if(Bwhat3==3||Bwhat3==9) Color(1);else if(Bwhat3==4||Bwhat3==10) Color(4);else if(Bwhat3==5||Bwhat3==11) Color(5);if(Bwhat3==11)cout<<' ';else if(Bwhat3==6) Color(3);else Color(2);cout<<"●-";Setpos(Bx3,By3);if(Bwhat3==11)cout<<"/";else cout<<"┃";Color(0);Setpos(Bx3+1,By3-1),cout<<"●●●";}
        if(X<0)return;if(Ren==2) Color(12);if(Ren==3) Color(1);if(Ren==4) Color(3);if(Ren==5) Color(4);if(Ren==6) Color(2);if(Drug!=0&&T%5!=0) Color(11);if(Drug!=0&&T%5==0) Color(11);if(Ice!=0) Color(6);if(b==1) Color(8);if(Li!=0) Color(5);if(Ren==1&&Killb>0&&T%4<2) Color(13);if(Wind>0&&T%4<=1) Color(1);if(Wind>0&&T%4>=2) Color(0);if(Thun>0&&T%4<=1) Color(1);if(Thun>0&&T%4>=2) Color(6);
        if(X>=17&&X<=19){Setpos(X-1,Y);cout<<"●";Setpos(X,Y-1);cout<<"━/";if(T%10<3) Setpos(X+1,Y-1),cout<<"┛╲";else if(T%10<6) Setpos(X+1,Y-1),cout<<"┦ ";else Setpos(X+1,Y-1),cout<<"╯>";if(Wind>0&&T%3==0) Setpos(X+1,Y-1),cout<<"┛╲";else if(Wind>0&&T%3==1) Setpos(X+1,Y-1),cout<<"┦ ";else if(Wind>0&&T%3==2)Setpos(X+1,Y-1),cout<<"╯>";}else if(X<=23&&X>=21){Setpos(X+1,Y);cout<<"●";Setpos(X,Y-1);cout<<"━\\";if(T%10<3) Setpos(X-1,Y-1),cout<<"┓╱";else if(T%10<6) Setpos(X-1,Y-1),cout<<"┪ ";else Setpos(X-1,Y-1),cout<<"╮>";if(Wind>0&&T%3==0) Setpos(X-1,Y-1),cout<<"┓╱";else if(Wind>0&&T%3==1) Setpos(X-1,Y-1),cout<<"┪ ";else if(Wind>0&&T%3==2)Setpos(X-1,Y-1),cout<<"╮>";}else if(X>23){Setpos(X,Y-1);cout<<"━ ●";Setpos(X-1,Y-0.5),cout<<"│>";}else if(X<17&&Upt!=0){Setpos(X,Y-1);cout<<"━ ●";Setpos(X+1,Y-1.5),cout<<"╱ >";}else if(X<17){Setpos(X,Y-1);cout<<"━ ●";Setpos(X+1,Y-0.5),cout<<"│>";}if(Thun>0){Setpos(X-2,Y-1),cout<<"▄▄";Setpos(X+2,Y-1),cout<<"▄▄";Setpos(X,Y+2),cout<<"▌";Setpos(X,Y-2.5),cout<<"▌";Setpos(X-1,Y+1),cout<<"█";Setpos(X+1,Y+1),cout<<"█";Setpos(X-1,Y-2),cout<<"█";Setpos(X+1,Y-2),cout<<"█";}if(Magne>0&&T%7<2)Setpos(X,Y),Color(5),cout<<"★";if(Wind>1){if(T%6<2)Color(1);else Color(0);if(T%8<=1){Setpos(X+1,Y-5);cout<<"----  --";Setpos(X,Y-5);cout<<"-  --- -";Setpos(X-1,Y-5);cout<<"--- - --";}else if(T%8<=3){Setpos(X+1,Y-5);cout<<"------  ";Setpos(X,Y-5);cout<<" --  ---";Setpos(X-1,Y-5);cout<<"----- - ";}else if(T%8<=5){Setpos(X+1,Y-5);cout<<"  ------";Setpos(X,Y-5);cout<<"-- --  -";Setpos(X-1,Y-5);cout<<"- ----- ";}else if(T%8<=7){Setpos(X+1,Y-5);cout<<"--  ----";Setpos(X,Y-5);cout<<" --- -- ";Setpos(X-1,Y-5);cout<<"- - ----";}}if(Water!=0){Color(1);if(T%20<5){Setpos(X+2,Y-3);cout<<"■";Setpos(X+1,Y-3.5);cout<<"■";Setpos(X-1,Y-2.5);cout<<"■";Setpos(X-2,Y-3);cout<<"■";}else if(T%20<10||T%20>=15){Setpos(X+2,Y-3);cout<<"■";Setpos(X,Y-4);cout<<"■■";Setpos(X-2,Y-3);  cout<<"■";}else if(T%20<15){Setpos(X+2,Y-3.5);cout<<"■";Setpos(X+1,Y-3);cout<<"■";Setpos(X-1,Y-3.5);cout<<"■";Setpos(X-2,Y-3);cout<<"■";}}if(Fire!=0){if(T%6<3)Color(4);else Color(5);if(Fir>=1)Setpos(X,Y+1),cout<<"●";if(Fir>=2)Setpos(X+1,Y),cout<<"●";if(Fir>=3)Setpos(X-1,Y-1),cout<<"●";}
    }
    if(a==1||a==3){
        if(B[b].what==1){Nor;Setpos(B[b].x,B[b].y-1);if(ti(B[b].x)==20)cout<<"======";else cout<<"      ";if(B[b].life!=0){B[b].y-=B[b].vy;Setpos(B[b].x,B[b].y);if(B[b].How<=1) Color(13);else Color(4);cout<<"●";if(a==1) Pan(1,B[b].x,B[b].y,b);}}
        if(B[b].what==2){Nor;Setpos(B[b].x-1,B[b].y-1);if(ti(B[b].x-1)==20)cout<<"======";else cout<<"      ";Setpos(B[b].x,B[b].y-1);if(ti(B[b].x)==20)cout<<"======";else cout<<"      ";Setpos(B[b].x+1,B[b].y-1);if(ti(B[b].x+1)==20)cout<<"======";else cout<<"      ";if(B[b].life!=0){B[b].y-=B[b].vy;Setpos(B[b].x,B[b].y);Color(5);if(B[b].How==0){Setpos(B[b].x-1,B[b].y),cout<<"↑";Setpos(B[b].x,B[b].y-1),cout<<"←┼ →";Setpos(B[b].x+1,B[b].y),cout<<"↓";}else if(B[b].How==1){Setpos(B[b].x-1,B[b].y-1),cout<<"↖  ↗";Setpos(B[b].x,B[b].y),cout<<"╳";Setpos(B[b].x+1,B[b].y-1),cout<<"↙  ↘";} if(a==1) Pan(2,B[b].x,B[b].y,b);}}
        if(B[b].what==3||B[b].what==5){Nor;Setpos(B[b].x,B[b].y);if(ti(B[b].x)==20)cout<<"==";else cout<<"  ";if(B[b].life!=0){B[b].y-=B[b].vy;B[b].x-=B[b].vx;Setpos(B[b].x,B[b].y);if(B[b].How==1) Color(5);else Color(4);cout<<"◎";}}
        if(B[b].what==4){Nor;Setpos(B[b].x,fmax((float)0,B[b].y-8));if(ti(B[b].x)==20){for(int i=max(0,(int)B[b].y-8);i<=B[b].y;i++)cout<<"==";}else {for(int i=max(0,(int)B[b].y-8);i<=B[b].y;i++)cout<<"  ";}if(B[b].life!=0){B[b].y-=B[b].vy;Setpos(B[b].x,fmax((float)0,B[b].y-8));Color(6); for(int i=max(0,(int)B[b].y-8);i<=B[b].y;i++)cout<<"═"; if(a==1) Pan(4,B[b].x,B[b].y,b);}}
        if(B[b].what==6||B[b].what==8||B[b].what==9){Nor;Setpos(B[b].x-1,B[b].y);if(ti(B[b].x)-1==20)cout<<"==";else cout<<"  ";Setpos(B[b].x+1,B[b].y);if(ti(B[b].x)+1==20)cout<<"==";else cout<<"  ";Setpos(B[b].x,B[b].y-1);if(ti(B[b].x)==20)cout<<"======";else cout<<"      ";if(B[b].life!=0){B[b].y-=B[b].vy;B[b].x-=B[b].vx;Setpos(B[b].x,B[b].y-1);if(B[b].what==6){if(B[b].How<=1) Color(1); else Color(6);}if(B[b].what==9){if(B[b].How<=1) Color(4); else Color(8);}if(B[b].what==8)Color(5);Setpos(B[b].x-1,B[b].y);cout<<"︹";Setpos(B[b].x+1,B[b].y);cout<<"︺";Setpos(B[b].x,B[b].y-1);if(B[b].How%2==1) cout<<"〔●〕"; else cout<<"﹝○﹞"; if(a==1) Pan(6,B[b].x,B[b].y,b);}}
        if(B[b].what==7){Nor;Setpos(B[b].x,B[b].y);if(B[b].How<0) for(int i=19;i>=20+B[b].How;i--) {Setpos(i,B[b].y);cout<<"  ";}if(B[b].How>0) for(int i=21;i<=20+B[b].How;i++) {Setpos(i,B[b].y);cout<<"  ";}if(B[b].life!=0){B[b].y-=B[b].vy;if(B[b].How<0) for(int i=19;i>=20+B[b].How;i--) {Setpos(i,B[b].y);cout<<"║"; if(a==1) Pan(7,i,B[b].y,b);}if(B[b].How>0) for(int i=21;i<=20+B[b].How;i++) {Setpos(i,B[b].y);cout<<"║"; if(a==1) Pan(7,i,B[b].y,b);}}}
        if(B[b].what==10||B[b].what==11||B[b].what==12){Nor;Setpos(B[b].x,B[b].y);if(ti(B[b].x)==20)cout<<"==";else cout<<"  ";if(B[b].life!=0){B[b].x-=B[b].vx;B[b].y-=B[b].vy;if(B[b].How==1){B[b].vy-=0.2;}else B[b].vx-=0.35;if(B[b].x>=25) B[b].x=25,B[b].vx*=-0.8;if(B[b].what==11&&B[b].y<=1) B[b].y=1,B[b].vy*=-1;if(B[b].what==12&&B[b].y<=1) B[b].y=1,B[b].vx=0,B[b].vy=-0.5,B[b].How=1;Setpos(B[b].x,B[b].y);if(B[b].what==11)Color(1);else if(B[b].what==12)Color(5);else Color(0);if(B[b].t%4<2)cout<<"▃";else cout<<"▍";if(a==1) Pan(B[b].what,B[b].x,B[b].y,b);}}
        if(B[b].what>=13&&B[b].what<=17){Nor;Setpos(B[b].x,B[b].y);if(ti(B[b].x)==20)cout<<"====";else cout<<"    ";if(B[b].life!=0){B[b].x-=B[b].vx;B[b].y-=B[b].vy;Setpos(B[b].x,B[b].y);if(B[b].what==14) Color(1);else if(B[b].what==15) Color(4);else if(B[b].what==16) Color(5);else if(B[b].what==17) Color(3);else Color(2);cout<<"●";if(B[b].what==14)cout<<"*";if(B[b].what==15)cout<<"";if(B[b].what==16)cout<<"<";if(B[b].what==17)cout<<"X";} if(a==1) Pan(1,B[b].x,B[b].y,b);}
        if(B[b].what==98&&B[b].life!=0){B[b].y-=B[b].vy;Setpos(B[b].x,B[b].y);if(ti(B[b].x==20))cout<<"==";else cout<<"  ";if(B[b].y<=3)B[b].life=0;} 
        if(B[b].what>=99){if(B[b].y<=3)B[b].life=0;if(B[b].life!=0){B[b].y-=B[b].vy;Setpos(B[b].x,B[b].y);Color(5);if(B[b].what==99)cout<<"█";if(B[b].what>=100&&B[b].what<200){if(B[b].what%5==0)cout<<"胎";if(B[b].what%5==1)cout<<"神";if(B[b].what%5==2)cout<<"太";if(B[b].what%5==3)cout<<"帅";if(B[b].what%5==4)cout<<"了";}if(B[b].what>=200&&B[b].what<300){if(B[b].what%6==0)cout<<"神";if(B[b].what%6==1)cout<<"级";if(B[b].what%6==2)cout<<"胎";if(B[b].what%6==3)cout<<"神";if(B[b].what%6==4)cout<<"之";if(B[b].what%6==5)cout<<"光";}if(B[b].what>=300&&B[b].what<400){if(B[b].what%8==0)cout<<"颤";if(B[b].what%8==1)cout<<"抖";if(B[b].what%8==2)cout<<"吧";if(B[b].what%8==3)cout<<"无";if(B[b].what%8==4)cout<<"能";if(B[b].what%8==5)cout<<"的";if(B[b].what%8==6)cout<<"人";if(B[b].what%8==7)cout<<"类";}if(B[b].what>=400&&B[b].what<500){if(B[b].what%8==0)cout<<"还";if(B[b].what%8==1)cout<<"不";if(B[b].what%8==2)cout<<"快";if(B[b].what%8==3)cout<<"跪";if(B[b].what%8==4)cout<<"倒";if(B[b].what%8==5)cout<<"在";if(B[b].what%8==6)cout<<"朕";if(B[b].what%8==7)cout<<"前";}if(B[b].what>=500&&B[b].what<600){if(B[b].what%8==0)cout<<"看";if(B[b].what%8==1)cout<<"懂";if(B[b].what%8==2)cout<<"这";if(B[b].what%8==3)cout<<"句";if(B[b].what%8==4)cout<<"话";if(B[b].what%8==5)cout<<"的";if(B[b].what%8==6)cout<<"是";if(B[b].what%8==7)cout<<"猪";} if(a==1) Pan(1,B[b].x,B[b].y,b);}}
        if(B[b].what==-1){Nor;Setpos(B[b].x,B[b].y);if(ti(B[b].x)==20)cout<<"==";else cout<<"  ";if(Boss==0) B[b].life=0;else if(((Boss==1&&abs(B[b].x-Bx1)+abs(B[b].y-By1)<1.5)||(Boss==2&&abs(B[b].x-Bx2)+abs(B[b].y-By2)<1.5)||(Boss==3&&abs(B[b].x-Bx3)+abs(B[b].y-By3)<1.5)||(B[b].t==10))&&B[b].life==1) Bblo-=8+Lv*2,B[b].life=0;if(B[b].life!=0){if(Boss==1)B[b].x=B[b].x+(Bx1-B[b].x)/(10-B[b].t)*1.0,B[b].y=B[b].y+(By1-B[b].y)/(10-B[b].t)*1.0;if(Boss==2)B[b].x=B[b].x+(Bx2-B[b].x)/(10-B[b].t)*1.0,B[b].y=B[b].y+(By2-B[b].y)/(10-B[b].t)*1.0;if(Boss==3)B[b].x=B[b].x+(Bx3-B[b].x)/(10-B[b].t)*1.0,B[b].y=B[b].y+(By3-B[b].y)/(10-B[b].t)*1.0;Setpos(B[b].x,B[b].y);Color(7);if(B[b].t%2==0) cout<<"+";else cout<<"×";}}
        if(B[b].what<=-2&&B[b].what>=-9){Nor;Setpos(B[b].x-1,B[b].y);if(ti(B[b].x)-1==20)cout<<"==";else cout<<"  ";Setpos(B[b].x+1,B[b].y);if(ti(B[b].x)+1==20)cout<<"==";else cout<<"  ";Setpos(B[b].x,B[b].y-1);if(ti(B[b].x)==20)cout<<"======";else cout<<"      ";if(B[b].life!=0){B[b].y-=B[b].vy;B[b].x-=B[b].vx;if(B[b].what<=-3&&B[b].what>=-7){if(B[b].x<=7)B[b].x=7;if(B[b].x>=28)B[b].x=28;else if(B[b].x>=B[b].a+1&&B[b].How==1)B[b].How=0;else if(B[b].x<=B[b].a-1&&B[b].How==0)B[b].How=1;if(B[b].How==1&&B[b].vx>=-1)B[b].vx-=0.2;if(B[b].How==0&&B[b].vx<=1)B[b].vx+=0.2;}if(B[b].what==-2) Color(3);if(B[b].what==-3) Color(4);if(B[b].what==-4) Color(1);if(B[b].what==-5) Color(0);if(B[b].what==-6) Color(6);if(B[b].what==-7) Color(5);if(B[b].what==-8) Color(2);if(B[b].what==-9) Color(14);if(T%7<=1&&B[b].what==-5)Color(1);else if(T%7<=1)Color(0);Setpos(B[b].x-1,B[b].y);cout<<"︹";Setpos(B[b].x+1,B[b].y);cout<<"︺";Setpos(B[b].x,B[b].y-1);if(B[b].what==-2) cout<<"﹝镖﹞";if(B[b].what==-3) cout<<"﹝火﹞";if(B[b].what==-4) cout<<"﹝水﹞";if(B[b].what==-5) cout<<"﹝风﹞";if(B[b].what==-6) cout<<"﹝雷﹞";if(B[b].what==-7) cout<<"﹝磁﹞";if(B[b].what==-8) cout<<"﹝血﹞";if(B[b].what==-9) cout<<"﹝忍﹞"; if(a==1) Pan(-2,B[b].x,B[b].y,b);}}
        if(B[b].what==-11||B[b].what==-12){Nor;Setpos(B[b].x,B[b].y);if(ti(B[b].x)==20)cout<<"==";else cout<<"  ";if(B[b].life!=0){if(Magne>0)B[b].How++,B[b].x=B[b].x+(X-B[b].x)/(10-B[b].How)*1.0,B[b].y=B[b].y+(Y-B[b].y)/(10-B[b].How)*1.0;B[b].y-=B[b].vy;Setpos(B[b].x,B[b].y);if(B[b].what==-10) Color(5);if(B[b].what==-11) Color(7);if(T%7<=1)Color(0);cout<<"◆"; if(a==1) Pan(-1,B[b].x,B[b].y,b);}}
        if(B[b].what==-13){Nor;Setpos(B[b].x,B[b].y-0.5);if(ti(B[b].x)==20)cout<<"===";else cout<<"   ";if(B[b].life!=0){if(B[b].a==13880086){if(Boss==0) B[b].life=0;else if(((Boss==1&&abs(B[b].x-Bx1)+abs(B[b].y-By1)<1.5)||(Boss==2&&abs(B[b].x-Bx2)+abs(B[b].y-By2)<1.5)||(Boss==3&&abs(B[b].x-Bx3)+abs(B[b].y-By3)<1.5)||(B[b].t==5))&&B[b].life==1) Bblo-=8+Lv*2,B[b].life=0;if(B[b].life!=0){if(Boss==1)B[b].x=B[b].x+(Bx1-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(By1-B[b].y)/(5-B[b].t)*1.0;if(Boss==2)B[b].x=B[b].x+(Bx2-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(By2-B[b].y)/(5-B[b].t)*1.0;if(Boss==3)B[b].x=B[b].x+(Bx3-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(By3-B[b].y)/(5-B[b].t)*1.0;}}else{if(B[B[b].a].life==0) B[b].life=0;else if((abs(B[b].x-B[B[b].a].x)+abs(B[b].y-B[B[b].a].y)<1.5||(B[b].t==5))&&B[b].life==1) Exp+=2,B[B[b].a].life=B[b].life=0;if(B[b].life!=0){B[b].x=B[b].x+(B[B[b].a].x-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(B[B[b].a].y-B[b].y)/(5-B[b].t)*1.0;}}Setpos(B[b].x,B[b].y-0.5);if(T%6<3)Color(5);else Color(4);cout<<"●";}}
    }if(br<bl) {br=-1,bl=0;memset(B,0,sizeof(B));}Color(0);
}
void Move(){
    if(X<3) X=3;if(Y<1) Y=1,Vy=0;if(Y>29) Y=29,Vy=0;
    if(Ice!=0){X-=Vx/2.0;Y+=Vy/2.0;Vy=fmax(Vy-0.025,(float)0);if(T%6==0&&Up==0&&Y<Ding) Y+=0.25;if(T%6==3&&Up==0&&Y>=Ding) Y-=0.25;if(Up==0&&Y<=Ding-1.25) Vy=0.25;if(Up==0&&Y>=Ding+1.25&&Wind==0) Vy=-0.25;if(Up==0&&Down==0&&Vx>0&&X<=18) Up=0,Down=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";else if(Down==2&&X<=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";else if(Up==0&&Down==1&&Vx<0&&X>=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";else if(Up>0&&Down==0&&X>18) Up=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";else if(Down==2) Vx+=0.175;else if(Up>0&&Upt==0) Vx-=0.175;else if(Up>0&&Upt>0) {Vx=fmax(Vx-0.125,(float)0);if(Upt==1&&T%2==0)Map(-1,0);if(T%2==0)Upt--;}}
    else{X-=Vx;Y+=Vy;Vy=fmax(Vy-0.05,(float)0);if(Wind==0){if(T%6==0&&Up==0&&Y<Ding) Y+=0.5;if(T%6==3&&Up==0&&Y>=Ding) Y-=0.5;}else{if(T%2==0&&Up==0&&Y<Ding) Y+=0.5;if(T%2==1&&Up==0&&Y>=Ding) Y-=0.5;}if(Up==0&&Y<=Ding-1.25) Vy=0.5;if(Up==0&&Y>=Ding+1.25&&Wind==0) Vy=-0.5;if(Up==0&&Down==0&&Vx>0&&X<=18) Up=0,Down=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";else if(Down==2&&X<=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";else if(Up==0&&Down==1&&Vx<0&&X>=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";else if(Up>0&&Down==0&&X>18) Up=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";else if(Down==2) Vx+=0.35;else if(Up>0&&Upt==0) Vx-=0.35;else if(Up>0&&Upt>0) {Vx=fmax(Vx-0.25,(float)0);if(Upt==1)Map(-1,0); Upt--;}}
    for(int i=bl;i<=br;i++){
        if(B[i].what<98)if(B[i].x-B[i].vx<=5||B[i].x-B[i].vx>=30||B[i].y-B[i].vy<=0||B[i].y-B[i].vy>=30){B[i].life=0;Map(1,i);}
        for(int j=0;j<20;j++)if(B[i].what>0&&B[i].life!=0&&abs(B[i].x-I[j][0])<2&&B[i].y-I[j][1]<=2){Setpos(I[j][0],I[j][1]);if(I[j][0]==20) cout<<"===";else cout<<"   ";I[j][0]=I[j][1]=-1;B[i].life=0;Exp+=2;}
        if(B[i].t>=100)B[i].life=0;if(B[i].life==0&&i==bl) bl++;
        Map(1,i);if(B[i].life==0) continue;
        else{B[i].t++;
            if(B[i].what==1){if(B[i].y<=25&&B[i].How==0) B[i].vy=0,B[i].How=1;if(B[i].t==30) B[i].y+=1.5,B[i].How=2;if(B[i].t==35) B[i].vy=1.5,B[i].How=3;}
            if(B[i].what==2){if(B[i].t%3==0) B[i].How=!B[i].How;} 
            if(B[i].what==3||B[i].what==5){if(B[i].what==3&&B[i].y<=20) B[i].vy=0;if(B[i].what==5&&B[i].y<=21) B[i].vy=0;if(B[i].t>30&&B[i].t%2==0) B[i].How=!B[i].How;if(B[i].what==5&&B[i].t<=30&&B[i].x<X) B[i].vx=-0.2;else if(B[i].what==5&&B[i].t<=70&&B[i].x>X) B[i].vx=0.2;else B[i].vx=0;if(B[i].t==45){B[i].life=0;br++;B[br].what=4;B[br].x=B[i].x;B[br].y=32;B[br].vy=3;B[br].life=1;}}
            if(B[i].what==6||B[i].what==8||B[i].what==9){if(B[i].vx<0.25&&B[i].vy<0.25&&B[i].t>=50){B[i].life=0;if(B[i].life==0&&i==bl) bl++;Map(1,i);break;}if(B[i].t%5==0) B[i].How=rand()%4;if(B[i].what==9){if(B[i].t==7){X9:float xx=(rand()%41)/40.0,yy=(rand()%41)/40.0;if(xx<=0.5&&yy<=0.5) goto X9;for(int j=1;j<=4;j++){br++,B[br].what=9;B[br].t=11;B[br].x=B[i].x,B[br].y=B[i].y,B[br].vx=xx,B[br].vy=yy;if(j%2==0)swap(B[br].vx,B[br].vy),B[br].vy*=-1;if(j<=2)B[br].vx*=-1,B[br].vy*=-1;B[br].life=1;}B[i].life=0;}}if(B[i].what==8){if(B[i].x>X&&B[i].vx<1.2) B[i].vx+=fmax((float)0,0.2-B[i].t/25);if(B[i].x<X&&B[i].vx>-1.2) B[i].vx-=fmax((float)0,0.2-B[i].t/25);if(B[i].y>Y&&B[i].vy<1.2) B[i].vy+=fmax((float)0,0.2-B[i].t/25);if(B[i].y<Y&&B[i].vy>-1.2) B[i].vy-=fmax((float)0,0.2-B[i].t/25);}}
            if(B[i].what>=13&&B[i].what<=15&&B[i].How!=0){if(B[i].x==B[i].How)B[i].vx=0,B[i].How=0;}
            if(B[i].what==16){if(B[i].x<X&&B[i].vx>=-1) B[i].vx-=0.2;else if(B[i].x>X&&B[i].vx<=1) B[i].vx+=0.2;}
        }
        if(B[i].life==1&&B[i].a==0&&B[i].what>0){if(B[i].y>Y&&abs(B[i].x-X)<=3&&((B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y))<Dis) Dis=(B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y),Disb=i;else if(((B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y))<Dis1) Dis1=(B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y),Disb1=i;}
    }
}
void Guai(int R,int r){
    if(R==-1){br++;B[br].what=-1;B[br].x=X+rand()%3-1;B[br].y=Y+rand()%3-1;B[br].life=1;}
    if(R<=-2&&R>=-11){br++;B[br].what=R;B[br].x=B[br].a=r;B[br].y=29;if(R<=-3&&R>=-7)B[br].vx=-1;B[br].vy=1;B[br].life=1;}
    if(R==0){br++;B[br].what=1;B[br].x=r;B[br].y=29;B[br].vy=1;B[br].life=1;}
    if(R==1){br++;B[br].what=2;B[br].x=r;B[br].y=29;B[br].vy=1;B[br].life=1;}
    if(R==2||R==3){br++;B[br].what=2*R-1;B[br].x=r;B[br].y=29;B[br].vy=1;B[br].life=1;}
    if(R==4){br++;B[br].what=6;if(r<5)r=5;if(r>30)r=30;B[br].x=r;if(r==11||r==25) B[br].y=29-(rand()%20);else B[br].y=29;X4:B[br].vx=(rand()%21-10)/30.0;B[br].vy=(rand()%25)/30.0;if(B[br].vx<=0.8&&B[br].vy<=0.8)goto X4;int rx=rand()%50;if(rx==0) B[br].vx=0;B[br].life=1;}
    if(R==5){br++;B[br].How=r;B[br].what=7;if(B[br].How<0) B[br].x=19;if(B[br].How>0) B[br].x=21;B[br].y=29;B[br].vy=1;B[br].life=1;}
}
void CpGuai(int R,float x,float y,float xx,float yy){
    if(R==4){br++;B[br].what=6;B[br].x=x;B[br].y=y;B[br].vx=xx;B[br].vy=yy;B[br].life=1;}
    if(R==6||R==7||R==8){br++;B[br].what=4+R;B[br].x=x;B[br].y=y;B[br].vx=xx;B[br].vy=yy;B[br].life=1;}
}
void MesGuai(int a,int rr){
    int R=rand()%rr,r=-10086;
    if(R==0){if(a==1) r=(5+rand()%8)*2;if(a<=3&&a!=1) r=10+rand()%16;if(a==4) r=rand()%75-20;if(a==5) r=2+rand()%4;if(r!=-10086) Guai(a,r);}
}
void NorGuai(int a,int b){
    if(a==1) {if(b==1||b==41) Guai(0,15),Guai(0,17),Guai(0,19);if(b==21||b==61) Guai(0,21),Guai(0,23),Guai(0,25);if(b==81) Guai(0,11),Guai(0,13),Guai(0,15),Guai(0,17),Guai(0,19);if(b==101||b==141) Guai(0,17),Guai(0,19),Guai(0,21),Guai(0,23),Guai(0,25);if(b==121) Guai(0,15),Guai(0,17),Guai(0,19),Guai(0,21),Guai(0,23);if(b>=160&&b<=260&&b%10==0) Guai(0,b/10-1);if(b>=270&&b<=370&&b%10==0) Guai(0,52-b/10);if(b>=460&&b<=560&&b%10==0) Guai(0,b/10-37),Guai(0,b/10-36),Guai(0,b/10-35);if(b>=570&&b<=670&&b%10==0) Guai(0,78-b/10),Guai(0,77-b/10),Guai(0,76-b/10);if(b>=760&&b<=960&&b%10==0) Guai(0,b/10-66),Guai(0,b/10-65),Guai(0,103-b/10),Guai(0,104-b/10);if(b>=1000&&b<=1300) MesGuai(0,30-b/50);}
    if(a==2) {if(b<=200&&b%30==1) {int r=rand()%4;if(r==1) r=0;for(int i=0;i<4;i++) if(i!=r) Guai(1,i*4+9);}if(b>200&&b<=220&&b%5==1) Guai(1,18);if(b>220&&b<=300&&b%7==1) Guai(1,b/5-26);if(b>350&&b<=370&&b%5==1) Guai(1,22);if(b>370&&b<=450&&b%7==1) Guai(1,96-b/5);if(b==461||b==501||b==541) Guai(1,13),Guai(1,17),Guai(1,21);if(b==481||b==521||b==561) Guai(1,17),Guai(1,21),Guai(1,25);if(b>=561&&b<=861&&b%20==1) Guai(1,b/40+5);if(b>=561&&b<=861&&b%20==11) Guai(1,35-b/40);if(b>=801&&b<=961&&b%15==1) Guai(1,20);if(b>=1000&&b<=1300) MesGuai(1,30-b/50);}
    if(a==3) {if(b==1||b==61) Guai(3,15),Guai(2,17),Guai(2,19);if(b==31||b==91) Guai(2,21),Guai(2,23),Guai(3,25);if(b>=120&&b<=220&&b%10==0) Guai(2,b/10+3);if(b>=240&&b<=340&&b%10==0) Guai(2,49-b/10);if(b>=360&&b<=460&&b%20==0) Guai(2,b/10-21),Guai(2,61-b/10);if(b>=480&&b<=580&&b%20==0) Guai(3,b/10-33),Guai(3,73-b/10);if(b>=600&&b<750&&b%30==0) {for(int i=0;i<5;i++) Guai(3,i*3+10);}if(b>=750&&b<830&&b%10==0) if(b<=200&&b%40==1) Guai(2,X);if(b>=830&&b<910&&b%20==0) Guai(2,X);if(b>=910&&b<980&&b%10==0) Guai(2,X);if(b>=1000&&b<=1300) MesGuai(rand()%2+2,40-b/50);}
    if(a==4) {if(b==1) CpGuai(4,10,29,-0.4,0.7),CpGuai(4,14,29,-0.2,0.7),CpGuai(4,21,29,0,0.65);if(b==41) CpGuai(4,10,29,-0.2,0.7),CpGuai(4,14,29,-0.1,0.7),CpGuai(4,18,29,0,0.65);if(b==81) CpGuai(4,5,20,-0.4,0.35),CpGuai(4,10,29,-0.4,0.7),CpGuai(4,14,29,-0.2,0.7),CpGuai(4,30,20,0.25,0.4),CpGuai(4,21,29,0,0.65);if(b==121) CpGuai(4,5,20,-0.2,0.35),CpGuai(4,10,29,-0.2,0.7),CpGuai(4,14,29,-0.1,0.7),CpGuai(4,30,20,0.4,0.4),CpGuai(4,18,29,0,0.65);if(b==161) CpGuai(4,10,29,-0.4,0.7),CpGuai(4,14,29,-0.2,0.7),CpGuai(4,21,29,0,0.6),CpGuai(4,10,29,-0.2,0.7),CpGuai(4,14,29,-0.1,0.7),CpGuai(4,18,29,0,0.65);if(b>=200&&b<=500&&b%40==1) {float r=0,rr;for(int i=1;i<=5;i++){X5:rr=0.7+(rand()%5)/10.0;if(rr==r)goto X5;r=rr;CpGuai(4,i*3+7,29,0,0.5+(rand()%50)/80.0);}}if(b>540&&b<=565&&b%5==1) CpGuai(4,5,8,-2,0.2);if(b>590&&b<=615&&b%5==1) CpGuai(4,30,8,1.5,0.2);if(b>640&&b<=665&&b%5==1) CpGuai(4,5,8,-1.5,0.3);if(b>690&&b<=715&&b%5==1) CpGuai(4,30,8,2,0.3);if(b>=750&&b<=950&&b%20==1) {float r=0,rr;for(int i=1;i<=3;i++){X6:rr=0.7+(rand()%5)/10.0;if(rr==r)goto X6;r=rr;CpGuai(4,i*5+7+(rand()%3),29,0,0.5+(rand()%50)/200.0);}}if(b>=1000&&b<=1300) MesGuai(4,5);}
}
void RandGood(){
    if(Biao>0){Biao--;Guai(-1,0);}
    if(Gd[1]==0){Gd[1]=rand()%1000+1;if(Win==7)Gd[1]=10086;Gd[3]=rand()%16+8;}
    else if(Gd[1]<=5){Guai(-2-Gd[1],Gd[3]);memset(Gd,0,sizeof(Gd));}
    else if(Gd[1]>=20&&Gd[1]<27){Guai(-8,Gd[3]);memset(Gd,0,sizeof(Gd));}
    else if(Gd[1]>=30&&Gd[1]<37){Guai(-9,Gd[3]);memset(Gd,0,sizeof(Gd));}
    else if(Gd[1]>=40&&Gd[1]<70){Gd[2]++;if(Gd[2]%2==1)Guai(-10,Gd[3]);if(Gd[2]>=9)memset(Gd,0,sizeof(Gd));}
    else if(Gd[1]>=70&&Gd[1]<100){Gd[2]++;if(Gd[2]%2==1)Guai(-11,Gd[3]);if(Gd[2]>=9)memset(Gd,0,sizeof(Gd));}
    else if(Boss!=0&&Gd[1]>=450&&Gd[1]<=500){Guai(-2,Gd[3]);memset(Gd,0,sizeof(Gd));}
    else Gd[1]=0;
    for(int i=0;i<20;i++){if(I[i][0]==-1) continue;Setpos(I[i][0],I[i][1]);Color(0);if(I[i][0]==20) cout<<"===";else cout<<"   ";I[i][1]++;if(I[i][0]>=28||I[i][0]<=0||I[i][1]>=29) I[i][0]=I[i][1]=-1;else Color(1),Setpos(I[i][0],I[i][1]),cout<<"■";Color(0);}
}
void Panboss(int bx,int by){
    float Nox[4],Noy[4];Nox[0]=X,Noy[0]=Y;
    if(Down==1&&X==22) Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=X-1,Noy[2]=Y-0.5;
    else if(Down==2) Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=-10,Noy[2]=-10;
    else if(Down==1||X<18) Nox[1]=X-1,Noy[1]=Y-0.5,Nox[2]=-10,Noy[2]=-10;
    else Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=X-1,Noy[2]=Y-0.5;
    for(int i=0;i<3;i++){if((Boss==1||Boss==6)&&Wind==0&&Thun==0&&abs(Nox[i]-bx)<1&&abs(Noy[i]-by)<1&&Bgo1[4]==0) Blo-=20,Bgo1[4]=1,Killb=20,Kill=1;if((Boss==2||Boss==6)&&Wind==0&&Thun==0&&abs(Nox[i]-bx)<1&&abs(Noy[i]-by)<1&&Bgo2[8]==0) Blo-=20,Bgo2[8]=1,Killb=20,Kill=1;}
}
void Boss1(){
    for(int j=0;j<20;j++)if(abs(Bx1-I[j][0])<2&&By1-I[j][1]<=2){Setpos(I[j][0],I[j][1]);if(I[j][0]==20) cout<<"===";else cout<<"   ";I[j][0]=I[j][1]=-1;Bblo-=8+Lv*2;Exp+=2;}
    if(Bbr==Bbl&&Bbr!=0) Bbr=Bbl=0;
    for(int i=1;i<=3+(Bbl-Bbr)/5;i++)if(Bbr<Bbl){Setpos(Bway[Bbr][0],Bway[Bbr][1]);if(Bway[Bbr][0]==20) cout<<"==";else cout<<"  ";Bbr++;}
    if(Bwhat1==5){int bx,by;Color(5);for(int i=0;i<10;i++){bx=Bx1-i*Bvx1/10.0;by=By1-i*Bvy1/10.0;Setpos(bx,by),cout<<"█";Bbl++;Bway[Bbl][0]=bx;Bway[Bbl][1]=by;}Color(0);}
    Bx1-=Bvx1;By1-=Bvy1;
    if(Bwhat1==0){X2:Bwhat1=rand()%7;if(Bwhat1==2||Bwhat1==3){if(By1<=10||By1>25) goto X2;}if(Bwhat1==4){if(By1<=15||Bx1<20) goto X2;Bgo1[2]=Bx1;Bgo1[3]=By1-1;}if(Bwhat1==5) {X0:Bgo1[3]=rand()%4+1;Bvx1=(rand()%101)/20.0;Bvy1=(rand()%101)/20.0;if(Bgo1[3]<=2) Bvx1*=-1;if(Bgo1[3]%2==1) Bvy1*=-1;if(abs(Bvx1)+abs(Bvy1)<=3||Out1)goto X0;}if(Bwhat1==6){if(By1<=17||By1>25) goto X2;}}
    if(Bwhat1==1){Bgo1[1]++,Bgo1[2]++;int R=rand()%(5-Bgo1[1]),r=rand()%(10-Bgo1[2]);if(Out1) R=0;if(R==0) {int vx=Bvx1,vy=Bvy1;Bgo1[1]=0;Bvx1=(rand()%101-20)/50.0;Bvy1=(rand()%101-20)/50.0;if(Bgo1[3]<=2) Bvx1*=-1;if(Bgo1[3]%2==1) Bvy1*=-1;if(Out1) r=0;} if(r==0) Chang1 }
    if(Bwhat1==2){Bgo1[1]++;if(Bgo1[1]>6){Bvy1=-0.3;br++;B[br].x=Bx1,B[br].y=By1-1;B[br].what=6;X3:B[br].vx=(rand()%21-10)/40.0;B[br].vy=(rand()%25)/30.0;if(B[br].vx<=0.8&&B[br].vy<=0.8)goto X3;int rx=rand()%50;if(rx==0) B[br].vx=0;B[br].life=1;}if(Bgo1[1]>8) Chang1}
    if(Bwhat1==3){Bgo1[1]++;if(Bgo1[1]>6&&Bgo1[1]%3==0){Bvy1=-0.3;br++;B[br].x=Bx1,B[br].y=By1-1;B[br].what=8;B[br].life=1;}if(Bgo1[1]>15) Chang1}
    if(Bwhat1==4){Bgo1[1]++;if(Bgo1[1]<=8){Setpos(Bgo1[2],Bgo1[3]);if(Bgo1[1]==1)cout<<" ";else if(Bgo1[1]>1&&Bgo1[2]==20) cout<<"==";else cout<<"  ";Bgo1[2]--;Setpos(Bgo1[2],Bgo1[3]);int r=rand()%4;if(r%2==0) Color(6);else Color(9);if(r<2) cout<<") ";else cout<<"】";Color(0);}if(Bgo1[1]==6) Bgo1[5]=X,Bgo1[6]=Y;if(Bgo1[1]==11){Map(0,(bool)Kill);Setpos(Bgo1[5],Bgo1[6]+1),cout<<"  ";Setpos(Bgo1[5],Bgo1[6]-1),cout<<"  ";Setpos(Bgo1[5]+1,Bgo1[6]),cout<<"  ";Setpos(Bgo1[5]-1,Bgo1[6]),cout<<"  ";int bx,by,bvx=Bgo1[2]-Bgo1[5],bvy=Bgo1[3]-Bgo1[6];Color(6);int i=0;while(1){bx=Bgo1[2]-i*bvx/30.0;by=Bgo1[3]-i*bvy/30.0;if(bx<=5||bx>=30||by<0||by>=29) break;Panboss(bx,by);Setpos(bx,by),cout<<"█";Bbl++;Bway[Bbl][0]=bx;Bway[Bbl][1]=by;i++;}Color(0);Map(-1,0);Chang1}}
    if(Bwhat1==5){Bgo1[1]++,Bgo1[2]++;int R=rand()%(5-Bgo1[1]),r=rand()%(10-Bgo1[2]);if(Out1) R=0;if(R==0) {int vx=Bvx1,vy=Bvy1;Bgo1[1]=0;X1:Bvx1=(rand()%101-20)/20.0;Bvy1=(rand()%101-20)/20.0;if(Bgo1[3]<=2) Bvx1*=-1;if(Bgo1[3]%2==1) Bvy1*=-1;if(abs(Bvx1)+abs(Bvy1)<=3||abs(Bvx1-vx)<=1||abs(Bvy1-vy)<=1)goto X1;if(Out1) r=0;} if(r==0) Chang1 }
    if(Bwhat1==6){Bgo1[1]++;if(Bgo1[1]>6&&Bgo1[1]%10==0){By1-=1;br++;B[br].x=Bx1,B[br].y=By1-1;B[br].what=9;X30:B[br].vy=1;B[br].life=1;}if(Bgo1[1]>31) Chang1}
}
void Boss2(){
    for(int j=0;j<20;j++)if(abs(Bx2-I[j][0])<2&&By2-I[j][1]<=2){Setpos(I[j][0],I[j][1]);if(I[j][0]==20) cout<<"===";else cout<<"   ";I[j][0]=I[j][1]=-1;Bblo-=8+Lv*2;Exp+=2;}
    if(Bbr==Bbl&&Bbr!=0) Bbr=Bbl=0;
    for(int i=1;i<=3+(Bbl-Bbr)/5;i++)if(Bbr<Bbl){Setpos(Bway[Bbr][0],Bway[Bbr][1]);if(Bway[Bbr][0]==20) cout<<"==";else cout<<"  ";Bbr++;}
    Bx2-=Bvx2;By2-=Bvy2;
    if(Bwhat2==0){X21:Bwhat2=rand()%7;if(Bwhat2==2){X31:for(int i=1;i<=3;i++){Bgo2[i*2+1]=rand()%28+1,Bgo2[i*2]=rand()%25+5;if((abs(Bgo2[i*2]-Bx2)<=2&&abs(Bgo2[i*2+1]-By2)<=2)||(abs(Bgo2[i*2]-X)<=2&&abs(Bgo2[i*2+1]-Y)<=2))goto X31;}if(Bgo2[2]==Bgo2[4]||Bgo2[2]==Bgo2[6]||Bgo2[6]==Bgo2[4]||Bgo2[5]==Bgo2[3]||Bgo2[3]==Bgo2[7]||Bgo2[5]==Bgo2[7]) goto X31;}if(Bwhat2==3){Bgo2[2]=rand()%2;}if(Bwhat2==4||Bwhat2==5||Bwhat2==6){Bvy2=-1.5;Bvx2=-0.5;}}
    if(Bwhat2==1){Bgo2[1]++,Bgo2[2]++;int R=rand()%(5-Bgo2[1]),r=rand()%(30-Bgo2[2]);if(Out2) R=0;if(R==0) {int vx=Bvx2,vy=Bvy2;Bgo2[1]=0;Bvx2=(rand()%101-20)/50.0;Bvy2=(rand()%101-20)/50.0;if(Bgo2[3]<=2) Bvx2*=-1;if(Bgo2[3]%2==1) Bvy2*=-1;if(Out2) r=0;} if(r==0) Chang2 }
    if(Bwhat2==2){Bgo2[1]++;float bx,by,bvx,bvy;if(Bgo2[1]<21){for(int i=1;i<=3;i++){bvx=Bgo2[i*2]-Bx2,bvy=Bgo2[i*2+1]-By2;if(Bgo2[1]<=10){Setpos(Bx2+(Bgo2[1]-1)*bvx/10.0,By2+(Bgo2[1]-1)*bvy/10.0);if(abs(Bx2+(Bgo2[1]-1)*bvx/10.0-20)<0.5)cout<<"==";else cout<<"  ";bx=Bx2+Bgo2[1]*bvx/10.0;by=By2+Bgo2[1]*bvy/10.0;Setpos(bx,by);}else Setpos(Bgo2[i*2],Bgo2[i*2+1]);int r=rand()%4;if(r%2==0) Color(3);else Color(10);if(r<=1) cout<<"×";else cout<<"+";Color(0);}}if(Bgo2[1]==21){Map(0,(bool)Kill);Color(3);int j=0;for(int j=0;j<=30;j++)for(int i=1;i<=3;i++)for(int k=1;k<=4;k++){if(k==1) bvx=j,bvy=0;if(k==2) bvx=-j,bvy=0;if(k==3) bvx=0,bvy=j;if(k==4) bvx=0,bvy=-j;bx=Bgo2[i*2]+bvx,by=Bgo2[i*2+1]+bvy;if(bx<=5||bx>=30||by<0||by>=30) {continue;}Panboss(bx,by);Setpos(bx,by),cout<<"█";Bbl++;Bway[Bbl][0]=bx;Bway[Bbl][1]=by;}Color(0);Map(-1,0);Chang2}}
    if(Bwhat2==3){Bgo2[1]++;if(Bgo2[1]<=18){if(Bgo2[3]==0) Setpos(Bgo2[4]-3,Bgo2[5]),cout<<"  ",Setpos(Bgo2[4]+3,Bgo2[5]),cout<<"  ",Color(0),Setpos(20,Bgo2[5]),cout<<"==";if(Bgo2[3]==1) Setpos(Bgo2[4],Bgo2[5]-3.5),cout<<"    ",Setpos(Bgo2[4],Bgo2[5]+2.5),cout<<"    ",Color(0),Setpos(20,Bgo2[5]+2.5),cout<<"====",Setpos(20,Bgo2[5]-3.5),cout<<"====";if(Bgo2[1]%4==0)Bgo2[3]=!Bgo2[3];if(Bgo2[1]%6<3)Color(3);else Color(5);if(Bgo2[3]==0) Setpos(X-3,Y),cout<<"▼",Setpos(X+3,Y),cout<<"▲",Bgo2[4]=(int)(X+0.5),Bgo2[5]=(int)(Y+0.5);if(Bgo2[3]==1) Setpos(X,Y-3),cout<<" ",Setpos(X,Y+3),cout<<" ",Bgo2[4]=(int)(X+0.5),Bgo2[5]=(int)(Y+0.5);Color(0);}if(Bgo2[1]==18){if(Bgo2[3]==0) Setpos(Bgo2[4]-3,Bgo2[5]),cout<<"  ",Setpos(Bgo2[4]+3,Bgo2[5]),cout<<"  ",Color(0),Setpos(20,Bgo2[5]),cout<<"==";if(Bgo2[3]==1) Setpos(Bgo2[4],Bgo2[5]-3.5),cout<<"    ",Setpos(Bgo2[4],Bgo2[5]+2.5),cout<<"    ",Color(0),Setpos(20,Bgo2[5]+2.5),cout<<"====",Setpos(20,Bgo2[5]-3.5),cout<<"====";}if(Bgo2[1]>18&&Bgo2[1]<=25){Bgo2[3]=Bgo2[2];if(Bgo2[3]==0) Setpos(Bgo2[4]-3,Bgo2[5]),cout<<"  ",Setpos(Bgo2[4]+3,Bgo2[5]),cout<<"  ",Color(0),Setpos(20,Bgo2[5]),cout<<"==";if(Bgo2[3]==1) Setpos(Bgo2[4],Bgo2[5]-3.5),cout<<"    ",Setpos(Bgo2[4],Bgo2[5]+2.5),cout<<"    ",Color(0),Setpos(20,Bgo2[5]+2.5),cout<<"====",Setpos(20,Bgo2[5]-3.5),cout<<"====";if(Bgo2[1]%4<2)Color(3);else Color(5);if(Bgo2[3]==0) Setpos(Bgo2[4]-3,Bgo2[5]),cout<<"▼",Setpos(Bgo2[4]+3,Bgo2[5]),cout<<"▲";if(Bgo2[3]==1) Setpos(Bgo2[4],Bgo2[5]-3),cout<<" ",Setpos(Bgo2[4],Bgo2[5]+3),cout<<" ";Color(0);}if(Bgo2[1]==25){if(Bgo2[2]==0){Color(3);for(int i=4;i<=29;i++){Setpos(i,Bgo2[5]),cout<<"█";Bbl++;Panboss(i,Bgo2[5]);Bway[Bbl][0]=i;Bway[Bbl][1]=Bgo2[5];}}if(Bgo2[2]==1){Color(3);for(int i=0;i<=28;i++){Setpos(Bgo2[4],i),cout<<"█";Bbl++;Panboss(Bgo2[4],i);Bway[Bbl][0]=Bgo2[4];Bway[Bbl][1]=i;}}Chang2}}
    if(Bwhat2==4||Bwhat2==5||Bwhat2==6){Bgo2[1]++;if(By2>27)Bvy2=0;if(Bx2>23)Bvx2=0;if(Bgo2[1]>13&&Bgo2[1]%3==0){float t=By2-Y,g=0.35;if(Boss==6) t/=2.0;CpGuai(Bwhat2+2,Bx2,By2,(Bx2-X)/t*1.0+(t-1)*g/2.0,1);}if(Bgo2[1]>20) Chang2}
}
void Boss3(){
    #define Bean br++;B[br].what=13;B[br].x=Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].life=1;
    for(int j=0;j<20;j++)if(abs(Bx3-I[j][0])<2&&By3-I[j][1]<=2){Setpos(I[j][0],I[j][1]);if(I[j][0]==20) cout<<"===";else cout<<"   ";I[j][0]=I[j][1]=-1;Bblo-=8+Lv*2;Exp+=2;}
    Bx3-=Bvx3;By3-=Bvy3;
    if(Bwhat3<=8){if(Bx3>X&&Bvx3<1.5) Bvx3+=0.3;if(Bx3<X&&Bvx3>-1.5) Bvx3-=0.3;}
    if(Bwhat3==0){X22:Bwhat3=rand()%12;if(Bwhat3==11&&abs(Bx3-20)<=1)goto X22;if(Bwhat3==11)Bgo3[2]=rand()%5;}
    if(Bwhat3==1){Bgo3[1]++;if(Bgo3[1]==6){br++;B[br].what=13;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].vx=1;B[br].How=(int)Bx3-4;B[br].life=1;br++;B[br].what=13;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].vx=-1;B[br].How=(int)Bx3+2;B[br].life=1;br++;B[br].what=13;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].life=1;Chang3}}
    if(Bwhat3>=2&&Bwhat3<=6){Bgo3[1]++;if(Bgo3[1]==6){br++;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].what=11+Bwhat3;B[br].vy=0.5+(rand()%100)/80.0;if(Bwhat3==5)B[br].vy=B[br].vy*3/4.0;B[br].life=1;Chang3}}
    if(Bwhat3==7){Bgo3[1]++;if(Bgo3[1]==6){br++;B[br].what=14;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].vx=1;B[br].How=(int)Bx3-4;B[br].life=1;br++;B[br].what=14;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].vx=-1;B[br].How=(int)Bx3+2;B[br].life=1;br++;B[br].what=14;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].life=1;Chang3}}
    if(Bwhat3==8){Bgo3[1]++;if(Bgo3[1]==6){br++;B[br].what=15;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].vx=1;B[br].How=(int)Bx3-4;B[br].life=1;br++;B[br].what=15;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].vx=-1;B[br].How=(int)Bx3+2;B[br].life=1;br++;B[br].what=15;B[br].x=(int)Bx3-1,B[br].y=By3-1;B[br].vy=1;B[br].life=1;Chang3}}
    if(Bwhat3==9){Bvx3=0;Bgo3[1]++;if(Bgo3[1]==6||Bgo3[1]==8){Bean}if(Bgo3[1]>=8)Chang3}
    if(Bwhat3==10){Bvx3=0;Bgo3[1]++;if(Bgo3[1]==6||Bgo3[1]==8||Bgo3[1]==10||Bgo3[1]==12){Bean}if(Bgo3[1]>=12)Chang3}
    if(Bwhat3==11){Bvx3=0;Bgo3[1]++;if(Bgo3[1]>=8)for(int i=1;i<=4;i++){br++;B[br].what=80+100*Bgo3[2]+Bgo3[1]*4+i;B[br].x=Bx3-1,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;br++;B[br].what=99;B[br].x=Bx3,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;br++;B[br].what=99;B[br].x=Bx3-2,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;}if(Bgo3[1]>=20){for(int i=1;i<=4;i++){br++;B[br].what=98;B[br].x=Bx3-1,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;br++;B[br].what=98;B[br].x=Bx3,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;br++;B[br].what=98;B[br].x=Bx3-2,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;}Chang3}}
}
void Ball(int ball){
    if(ball==1){int f=0;for(int i=1;i<=3;i++) {if(fir[i]==1) fir[i]--,Fir++;else if(fir[i]>1) fir[i]--;else f=i;}if(Fir>0&&f!=0){br++;B[br].what=-13;B[br].x=X;B[br].y=Y+rand()%3-1;B[br].life=1;if(Dis<=30) B[br].a=Disb,B[Disb].a=1,fir[f]=20,Fir--;else if(Boss!=0) B[br].a=13880086,fir[f]=20,Fir--;else if(Dis!=13880087) B[br].a=Disb,B[Disb].a=1,fir[f]=20,Fir--;else if(Dis1!=13880087) B[br].a=Disb1,B[Disb1].a=1,fir[f]=20,Fir--;else B[br].life=0;Dis=Dis1=13880087;}}
    if(ball==2){if(T%4==0)ib=(ib+1)%20,I[ib][1]=Y-2;if(T%16==0)I[ib][0]=X;if(T%16==4)I[ib][0]=X-1;if(T%16==8)I[ib][0]=X+1;if(T%16==12)I[ib][0]=X-2;if(T%12==9)I[ib][0]=X+2;if(Water==1){for(int i=X-6;i<=X+6;i++)ib=(ib+1)%20,I[ib][0]=i,I[ib][1]=Y-2-0.5*abs(i-X);}}
    if(ball==3){if(Wind>5){if(Y<Ding-1)Vy=5;else Vy=0;if(Up>=1) Vx=-5;if(Down==2) Vx=5;}if(Wind<5){if(Y>Ding-1)Vy=-5;else Vy=0;if(Up>=1) Vx=-5;if(Down==2) Vx=5;}if(Wind==5){if(Boss==2) Ding=12.25;else Ding=6.25;if(Boss!=0) Bblo-=16+Lv*4;if(Boss==1) Chang1 if(Boss==2) Chang2 if(Boss==3) Chang3 system("color 3F");Sleep(20);system("color 6F");Sleep(10);system("color 0F");system("cls");for(int i=bl;i<=br;i++)if(B[i].what>0)B[i].life=0;Setpos(20,0);for(int i=1;i<=60;i++) printf("=");}}
    if(ball==4){if(Thun==1){if(Boss!=0) Bblo-=16+Lv*4;if(Boss==1) Chang1 if(Boss==2) Chang2 if(Boss==3) Chang3 system("color 9F");Sleep(20);system("color 6F");Sleep(10);system("color 0F");system("cls");for(int i=bl;i<=br;i++)if(B[i].what>0)B[i].life=0;Setpos(20,0);for(int i=1;i<=60;i++) printf("=");}}
    if(ball==5){system("cls"); Color(5);Setpos(10,10);cout<<"新天赋!";Y:int rr=rand()%4+2;Setpos(12,10);if(rr==Ren) goto Y;if(rr==2)cout<<"瞬跳";if(rr==3)cout<<"空之舞";if(rr==4)cout<<"三段跳";if(rr==5)cout<<"反重力跳跃";Setpos(14,10);cout<<"当前天赋:";if(Ren==1)cout<<"小无敌";if(Ren==2)cout<<"瞬跳";if(Ren==3)cout<<"空之舞";if(Ren==4)cout<<"三段跳";if(Ren==5)cout<<"反重力跳跃";Setpos(16,10);cout<<"换否?(y/n)";G:char g=_getch();if(g=='y')Ren=rr;else if(g!='n')goto G;system("cls");Setpos(20,0);Color(0);for(int i=1;i<=60;i++) printf("=");}
    if(ball==6){Color(4);for(float i=1;i<=Bblo;i+=Bblomax/20.0)cout<<"▄";Color(0);cout<<' '<<Bblo<<"                              ";Color(0);}
    if(ball==7){Color(1);if(Win==7&&T%6<3)Color(3);for(float i=1;i<=Blo;i+=Blomax/20.0)cout<<"▄";Color(0);if(Win==7&&T%6<3)Color(3);printf(" %0.1f                              ",Blo);}
}
int main(){
    system("mode con cols=60 lines=37");CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);srand((unsigned)time(NULL));
    Win=0;Ren=1;Lv=1;Blo=Blomax=100;Expmax=300;Hui=15;X=18,Y=6;
    ReStart:system("cls");memset(B,0,sizeof(B));memset(I,-1,sizeof(I));T=0;bl=0;br=-1;Upt=0;
    Start:Blo=Blomax;Ding=6.25;
    memset(Bgo1,0,sizeof(Bgo1));memset(Bgo2,0,sizeof(Bgo2));memset(Bgo3,0,sizeof(Bgo3));
    if(Win%2==0) T=0;if(Win%2==0&&D==0){if(Win>0)Ball(5);Boss=0;lL:L=rand()%4+1;for(int i=0;i<=Win/2-1;i++)if(L==Ll[i]) goto lL;Ll[Win/2]=L;}if(Win%2==1&&D==0){if(Win==7)Boss=6,T=0,Blomax+=100;else{bl:Boss=rand()%3+1;for(int i=0;i<=3;i++)if(Boss==Bl[i]) goto bl;}Bl[Win/2]=Boss;Bwhat1=Bwhat2=Bwhat3=0,Bx1=10,By1=20,Bx2=15,By2=20,Bx3=21,By3=20;system("color 4C");Sleep(20);system("color 0F");Map(0,1);Sleep(1000);}if(Win%2==1){Bblomax=500+(Win/2)*500;Bblo=Bblomax;if(Boss==2) Ding=12.25;}
	while(1){
        T++;
        if(Wind==0){if(GetAsyncKeyState(VK_LEFT)&0x8000) Vy=-(10-abs(Ding-Y)*1.5)/20.0;if(GetAsyncKeyState(VK_RIGHT)&0x8000) Vy=(10-abs(Ding-Y)*1.5)/20.0;}if(GetAsyncKeyState(VK_UP)&0x8000&&u1==0) {u1++;if(Down==1){Down=0;Up=0;if(Ren==2)Map(-1,0),Vx=0,X=18,Li=5;else Vx=7,Vy=0.3;}else if(Up==0&&Wind==0) {Down=0;Up=1;if(Ren==2)Map(-1,0),Vx=1,X=10,Map(0,3),Li=5;else Vx=2,Vy=0.1;}else if(Up==1&&Wind==0) {Down=0;Up=2;if(Ren==2)Map(-1,0),Vx=1,X-=6,Map(0,3),Li=5;else Vx=1.5,Vy=0.1;}else if(Ren==3&&Up==2&&Wind==0) {Down=0;Up=3;Vx=1;Vy=0.5;Upt=30;}else if(Ren==4&&Up==2&&Wind==0) {Down=0;Up=3;Vx=1.8;Vy=0.1;}}if(GetAsyncKeyState(VK_DOWN)&0x8000&&u2==0) {u2++;if(Down==1&&Ren==5){Down=2;Up=0;Vx=-1.7;}else {Down=1;Up=0;if(Ren==2)Map(-1,0),Vx=0,X=22,Map(0,3),Li=5;else {if(Upt!=0) Map(-1,0),Upt=0;Vx=-7;}}}if((GetAsyncKeyState(VK_UP)&0x8000) ?0:1) u1=0;if((GetAsyncKeyState(VK_DOWN)&0x8000) ?0:1) u2=0;if(kbhit()){char g=_getch();if(g==' ') Sleep(100),Setpos(4,1),Sy++,system("pause");}if(Sy==1) Setpos(4,1),printf("                           "),Sy--;
        if(Drug==0) Blo=fmin((float)Blomax,Blo+Hui/100.0);else if(T%10==0)Blo--;if(T%20==0) {if(Kill!=0) Kill=0;if(Lvl!=0) Lvl=0;}if(Killb>0) Killb--;if(Li>0) Li--;if(Ice>0) Ice--;if(Drug>0) Drug--;if(Magne>0) Magne--;
        if(Fire>0) Ball(1),Fire--;if(Water>0) Ball(2),Water--;if(Wind>0) Ball(3),Wind--;if(Thun>0) Ball(4),Thun--;
        if(Boss==0) NorGuai(L,T%1500);RandGood();if(T%20==1)Exp++;
        if(T%50==1){Exp++;system("cls");Setpos(20,0);Color(0);for(int i=1;i<=60;i++) printf("=");if(Win==0&&T<300){Setpos(4,6);cout<<"上下 跳跃/下翻,左右 些微移动(松手即返回)"; Setpos(6,6);cout<<"球可以开启特殊效果,Exp积满(300)可提升 Lv。";Setpos(8,6);cout<<"打败 7 波即胜利,打败 BOSS 有新天赋。";Setpos(10,15);cout<<"空格可以暂停。";}}
        Map(-1,0);
        if(Boss==1) Boss1();if(Boss==2) Boss2();if(Boss==3) Boss3();if(Boss==6) Boss1(),Boss2(),Boss3();
        Move();Map(0,(bool)Kill);Color(0);
        Setpos(1,1);Blo=fmin(Blo,(float)Blomax);if(Boss==0)cout<<"Blood: "<<(int)Blo<<"  ";Color(0);Setpos(1,9),cout<<"Death: "<<D<<"  ";Setpos(2,1);Exp=min(Exp,Expmax);if(Exp>=Expmax)Exp=0,Lv++,Lvl++,Hui++,Blomax+=5;if(Lvl>0)Color(5);cout<<"Lv: "<<Lv;Color(0);Setpos(2,9);cout<<"Exp: "<<Exp<<"  ";if(Boss>0) Setpos(3,1),cout<<"Blood     : ",Ball(7);if(Boss>0&&Boss!=6) Setpos(4,1),cout<<"Boss Blood: ",Ball(6);if(Boss==6) Setpos(1,9),printf("Time: %0.1f s  ",T/15.0);
		int speed=0;
		if(Win==0) speed=55;if(Win==1) speed=50;if(Win==2) speed=35;if(Win==3) speed=40;if(Win==4) speed=25;if(Win==5) speed=30;if(Win==6) speed=20;if(Win>=7) speed=17;
		if(Wind) speed/=2;Sleep(speed);
        if(Boss==3&&Bblo<=0){for(int i=1;i<=4;i++){br++;B[br].what=98;B[br].x=Bx3-1,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;br++;B[br].what=98;B[br].x=Bx3,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;br++;B[br].what=98;B[br].x=Bx3-2,B[br].y=By3-1+i;B[br].vy=4;B[br].life=1;}}
        if((Win%2==0&&T>=1400)||(Win%2==1&&Bblo<=0)||(Win==7&&T>=450)||Blo<=0) {Map(-1,0);break;}
    }if(Blo<=0){Sleep(1000);D++;system("color 7F");Setpos(15,11);Color(4);cout<<"GAME OVER...";Sleep(2000);goto ReStart;}else if(Win==6){system("color 7F");Setpos(15,11);Color(4);cout<<"坚持30秒 !";Sleep(2000);Setpos(30,0);Win++;D=0;}else if(Win==7){Sleep(1000);system("color 6E");Setpos(15,11);Color(5);cout<<"YOU WIN !";Sleep(2000);Setpos(30,0);return 0;}else Sleep(1000),Win++,D=0;goto Start;
}

下期继续出

如果你对我感兴趣的话,就关注我吧(づ ̄3 ̄)づ╭❤~

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值