问题标题: 狼人杀

0
0
已解决
赵一璇
赵一璇
初级守护
初级守护
//狼人杀
#include<bits/stdc++.h>
#include <cstdlib>
#include <ctime>
#include <Windows.h>
#include <conio.h>
long long sr=0;
using namespace std;
void brc(){
    system("cls");
    long long jy=1,wd=3;
    long long sy=3,wj=3;
    srand((int)time(0));
    long long n=rand()%15+1;
    cout<<"                                你是"<<n<<"号"<<endl;
    cout<<"                               正在分配身份"<<endl;
    Sleep(1500);
    long long m[20];
    for(long long i=1;i<=15;i++)
        m[i]=1;
    long long s[20]={0};
    long long yy[20]={0};
    long long l=0,w=0,j=0,p=0;
    for(long long i=1;i<=15;i++)
    {
        do
        {
            long long a=rand()%4+1;
            if(a==1&&l<1)
            {
                l++;
                s[i]=1;
                sr=i;
            }
            else if(a==2&&w<2)
            {
                w++;
                s[i]=2;
            }
            else if(a==4&&p<3)
            {
                p++;
                s[i]=4;
            }
            else if(a==3&&j<9
            )
            {
                j++;
                s[i]=3;
            }
        }
        while(s[i]==0);
    }
    if(s[n]==1)
        cout<<"                               你是>>**<<"<<endl;
    else if(s[n]==2)
        cout<<"                               你是>>预言家<<"<<endl;
    else if(s[n]==3)
        cout<<"                               你是>>平民<<"<<endl;
    else
        cout<<"                               你是>>法师<<"<<endl;
    cout<<"                             游戏将在5秒后开始"<<endl; 
    Sleep(5000);
    long long c=15;
    long long f=0,flag=0;
    long long day=1;
    long long lr;
    long long tp[20]={0};
    do
    {
        lr=0;
        system("cls");
        cout<<"                                 第"<<day<<"晚开始"<<endl;
        cout<<"你是"<<n<<"号"<<endl;
        long long x;
        for(long long i=1;i<=15;i++) 
        {
            if(i==n&&m[n]==1)
            {
                if(s[n]==1)
                {
                    cout<<"                                 你是**"<<endl;
                    for(long long j=1;j<=15;j++)
                        if(m[j]==1&&s[j]!=1)
                            cout<<j<<" ";
                    cout<<endl;
                    cout<<"                                 你选择杀掉"<<endl; 
                    long long a;
                    cin>>a;
                    m[a]=0;
                    cout<<endl;
                    cout<<"                                 **杀了"<<a<<"号"; 
                    if(s[a]==1)
                        cout<<"(**)"<<endl;
                    else if(s[a]==2)
                        cout<<"(预言家)"<<endl;
                    else if(s[a]==3)
                        cout<<"(平民)"<<endl;
                    else
                        cout<<"(法师)"<<endl;
                    c--;
                }    
                else
                if(s[n]==2)
                {
                    cout<<"                                 你是预言家"<<endl;
                    cout<<"                               ";
                    for(long long j=1;j<=15;j++)
                        if(m[j]==1)
                            cout<<j<<" ";
                    cout<<endl<<"                              你选择预言谁的身份"<<endl;
                    long long a;
                    cin>>a;
                    if(s[a]==1)
                    {
                        cout<<"                        "<<a<<"号是**,请注意"<<endl;
                        Sleep(1000);
                    }
                    else
                        cout<<"                            "<<a<<"号是好人"<<endl; 
                }
            }
            else if(s[i]==1&&m[i]==1)
            {
                long long a;
                do
                {
                    a=rand()%15+1;
                }
                while(a==i||m[a]==0||s[a]==1);
                cout<<"                           **杀掉了"<<a<<"号"; 
                if(s[a]==1)
                    cout<<"(**)"<<endl;
                else if(s[a]==2)
                    cout<<"(预言家)"<<endl;
                else if(s[a]==3)
                    cout<<"(平民)"<<endl;
                else
                    cout<<"(法师)"<<endl;
                m[a]=0;
                c--;
                break;//
            }
            else if(s[i]==2)
            {
                if(flag==0||m[flag]==0)
                {
                    long long a;
                    do
                    {
                        a=rand()%15+1;
                    }
                    while(a==i||m[a]==0);
                    if(s[a]==1)
                        yy[a]=1;    
                    else if(s[a]==3)
                        yy[a]=3;
                }    
            }
            else if(s[i]==4)
            {
                f=0;
                while(f==0)
                {
                    long long a;
                    a=rand()%3+1;
                    if(a==3)break;
                    if(a==1)
                    {
                        if(sy>0)
                        {
                            sy--;
                            f=1; 
                            long long b;
                            do
                            {
                                b=rand()%15+1;
                                b=rand()%15+1;
                            }
                            while(b==i||m[b]==0);
                            m[b]=0;
                            cout<<"                           法师毒**了"<<b<<"号"; 
                            if(s[b]==1)
                                cout<<"(**)"<<endl;
                            else if(s[b]==2)
                                cout<<"(预言家)"<<endl;
                            else if(s[b]==3)
                                cout<<"(平民)"<<endl;
                            c--;
                            if(s[b]==1&&n!=sr)
                            {
                                cout<<endl<<"                               "<<sr<<"号是**!"; 
                                cout<<endl<<"                                **已**亡!"<<endl;
                                cout<<"                              游戏结束"<<endl;
                                return ;
                            }
                            break;
                        }
                    }
                    else if(a==2&&day>1)
                    {
                        if(jy>0)
                        {
                            jy--;
                            f=1; 
                            long long b;
                            do
                            {
                                b=rand()%15+1;
                            }
                            while(b==i||m[b]==1);
                            c++;
                            cout<<"                           法师复活了"<<b<<"号"<<endl;
                            m[b]=1;
                            if(m[sr]==0&&n!=sr)
                            {
                                cout<<endl<<"                               "<<sr<<"号是**!"; 
                                cout<<endl<<"                        **已**亡!"<<endl;
                                cout<<"                              游戏结束"<<endl;
                                return ;
                            }
                            break;//
                        }
                    }

                }
            }
        }
        if(s[n]==4)
        {
            cout<<"                                 你是法师"<<endl;
            cout<<"存活状况:"<<endl; 
            for(long long j=1;j<=15;j++)
                if(m[j]==1)
                    cout<<j<<" ";
            cout<<endl;
            cout<<"                        你选择 1.* 杀 *还是 2.* 救 * 3.* 啥都不做 *"<<endl;
            long long a,f=0;
            while(f==0)
            {
                cin>>a;
                if(a==3) break;
                if(a==1)
                {
                    if(wd>0)
                    {
                        wd--;
                        f=1; 
                        cout<<"                                你选择了**"<<endl;
                        for(long long i=1;i<=15;i++)
                            if(m[i]==1)
                                cout<<i<<" ";
                        cout<<endl; 
                        long long b;
                        cin>>b;
                        if(s[b]==1)
                            cout<<"(**)"<<endl;
                        else if(s[b]==2)
                            cout<<"(预言家)"<<endl;
                        else if(s[b]==3)
                            cout<<"(平民)"<<endl;
                        else
                            cout<<"(法师)"<<endl;
                        m[b]=0;
                        c--; 
                        if(m[sr]==0&&n!=sr)
                        {
                            cout<<endl<<"                               "<<sr<<"号是**!"; 
                            cout<<endl<<"                        **已**亡!"<<endl;
                            cout<<"                              游戏结束"<<endl;
                            return ;
                        }
                    }
                    else
                    {
                        cout<<">>毒药<<不足"<<endl; 
                    }
                }
                else if(a==2)
                {
                    if(wj>0)
                    {
                        wj--;
                        f=1; 
                        cout<<"你选择了复活"<<endl;
                        cout<<"阵亡名单:"<<endl;
                        for(long long i=1;i<=15;i++)
                            if(m[i]==0)
                                cout<<i<<"号,身份:"<<s[i]<<" "<<endl;;
                        long long b;
                        cin>>b;
                        m[b]=1;
                        c++;
                    }
                    else
                    {
                        cout<<">>复活药水<<不足"<<endl; 
                    }
                }
            }
        }
        Sleep(1000);
        long double p[20]={0};
        cout<<"                                 第"<<day<<"晚结束"<<endl;
        cout<<endl;
        if(m[n]==0)
        {
            cout<<"                             你已经>>**<<了";    
            break;
        }

        cout<<"                                    存活:"<<endl;
        cout<<"                       ";
        for(long long i=1;i<=15;i++)
            if(m[i]==1)
                cout<<i<<" ";
        cout<<endl;
        cout<<"                                    请投票...."<<endl;
        for(long long i=1;i<=15;i++)
        {
            if(i==n&&m[n]==1)
            {
                cout<<endl;
                cout<<"                                 你选择投几号"<<endl; 
                long long a=99;
                while(a==99) 
                {
                    cin>>a;
                    if(a==99)
                        for(long long i=1;i<=15;i++)
                            if(m[i]==1)
                                cout<<"                                    "<<i<<"."<<s[i]<<endl;
                }
                if(s[i]==3&&day>4)
                    p[a]+=1.5;
                else
                    p[a]++;    
                cout<<endl;
                cout<<"                                    "<<i<<"->"<<a<<endl;
                if(s[a]==3)
                {
                    tp[a]=i;
                }
            }
            else if(s[i]==1&&m[i]==1)
            {
                long long a;
                do
                {
                    a=rand()%15+1;    
                }
                while(m[a]==0||a==i||s[a]==1);
                p[a]++;
                cout<<"                                    "<<i<<"->"<<a<<endl;
                if(s[a]==3)
                {
                    tp[a]=i;
                }
            }
            else if(s[i]==2&&m[i]==1)
            {
                if(flag!=0)
                {
                    p[f]++;
                    cout<<"                                    "<<i<<"->"<<flag<<endl;
                }
                else
                {
                    long long a;
                    do
                    {
                        a=rand()%15+1;    
                    }
                    while(m[a]==0||a==i||yy[a]==3);
                    p[a]++;
                    if(s[a]==3){
                        tp[a]=i;
                    }
                    cout<<"                                    "<<i<<"->"<<a<<endl;
                }
            } 
            else if(s[i]==3&&m[i]==1)
            {
                if(tp[i]==0)
                {
                    long long a;
                    do
                    {
                        a=rand()%15+1;    
                    }
                    while(m[a]==0||a==i);
                    p[a]++;
                    cout<<"                                    "<<i<<"->"<<a<<endl;
                }
                else
                {
                    if(m[tp[i]]==1)
                    {
                        p[tp[i]]++;
                        cout<<"                                    "<<i<<"->"<<tp[i]<<endl;
                    }
                    else
                    {
                        long long a;
                        do
                        {
                            a=rand()%15+1;    
                        }
                        while(m[a]==0||a==i);
                        p[a]++;
                        cout<<"                                    "<<i<<"->"<<a<<endl;
                    }
                }
            }
            else if(s[i]==4&&m[i]==1)
            {
                long long a;
                do
                {
                    a=rand()%15+1;    
                }
                while(m[a]==0||a==i);
                p[a]++;
                cout<<"                                    "<<i<<"->"<<a<<endl;
            }
        }
        system("cls");
        cout<<"                                 投票情况:"<<endl;
        for(long long i=1;i<=15;i++)
            if(m[i]==1)
                cout<<"                                 "<<i<<"号"<<"  票数:"<<p[i]<<endl; 
        long long sw,max=-100; 
        for(long long i=1;i<=15;i++)
        {
            if(p[i]>max)
            {
                sw=i;
                max=p[i];
            }
        }
        m[sw]=0;
        cout<<"                                  "<<sw<<"**了"<<endl;
        c--;
        cout<<"                              "<<sw<<"号的身份是"; 
        if(s[sw]==1)
            cout<<"**"<<endl;
        else if(s[sw]==2)
            cout<<"预言家"<<endl;
        else if(s[sw]==3)
            cout<<"平民"<<endl;
        else 
            cout<<"法师"<<endl; 
        if(s[sw]==1&&n!=sr)
        {
            cout<<endl<<"                               "<<sr<<"号是**!"; 
            cout<<endl<<"                        **已**亡!"<<endl;
            cout<<"                              游戏结束"<<endl;
            return ;
        }
        day++;  
        if(s[n]!=1)   
        {
            for(long long i=1;i<=15;i++)
            if(s[i]==1&&m[i]==1)
                lr=1;
        }
        else
        {
            if(s[n]==1&&c==2)
                lr=0;
        }
        system("pause"); 
        cout<<endl;
        if(m[sr]==0&&n!=sr)
        {
            cout<<endl<<"                               "<<sr<<"号是**!"<<endl; 
            cout<<endl<<"                        **已**亡!"<<endl;
            cout<<"                              游戏结束"<<endl;
            return ;
        }
    }
    while(m[n]==1&&c>1);
    if(sr==n&&m[n]==1)
    {
        cout<<"                                你杀掉了所有人!!!"<<endl;
    }
    cout<<"                              游戏结束"<<endl;
    return ;
}
int main()
{
    srand((int)time(0));  
    char a='1';
    while(1)
    {
        system("cls");
        cout<<"                                               狼人杀"<<endl;
        cout<<"------------------------------------------------------------------------------------------------------------------------";
        cout<<"                                            1.开始游戏"<<endl;
        cout<<"                                          2.查看游戏规则"<<endl;
        a=getch();
        if(a=='1'){
            cout<<"                                            1. 15人场"<<endl;
            cout<<"                                      2. 30人娱乐战(10猎人)<敬请期待>"<<endl;
            Sleep(1000); 
            cout<<"                                         玩家:那怎么才能玩猎人呢?"<<endl;
            Sleep(1000); 
            cout<<"                                         喵韹:不都说了敬请期待吗?"<<endl;
            Sleep(1000); 
            cout<<"                                            玩家: ......"<<endl;
            Sleep(1000); 
            cout<<"                                              喵韹:你要相信作者"<<endl;
            Sleep(1000); 
            cout<<"                                              玩家:......";
            a='2';
            while(a=='2')
            {
                a=getch();
                switch(a)
                {
                    case '1':
                        brc();
                    break;
                }
                if(a=='1')
                    break;
            }
            if(a=='1')
                break;
        }
        else if(a=='2'){
            cout<<"                **:每当晚上的时候可使用**权杀掉一人"<<endl;
            cout<<"                预言家:每天晚上可以知道一个人的身份"<<endl;
            cout<<"                平民:无技能,当玩家是平民时,在第5天拥有1.5票的投票权"<<endl;
            cout<<"                猎人:此身份仅限于30人娱乐局中,**亡后可带走一人"<<endl; 
            cout<<"                投票细则:";
            cout<<"                \n                (游戏中除了你以外全是由超超超级AI人工代替)"<<endl;
            cout<<"                预言家如果预言到**将一直对他投票,如果预言到好人将永远不会对他投票"<<endl;
            cout<<"                平民将投上一个晚上对他投票他的人"<<endl;
            cout<<"                ********利用好超级AI游戏规则找出************"<<endl;
            cout<<"                建议:拿张纸,进行记录"<<endl;
            cout<<"                本游戏制作者——喵韹,如有雷同,纯属不正常!!"<<endl;
            cout<<"                ";
            system("pause");
        }
    }
    return 0;
}

 


0
0
0
0
赵一璇
赵一璇
初级守护
初级守护
#include<iostream>
#include<fstream> 
#include<windows.h>
#include<cstdio>
#include<cstring>
#include<stdio.h>
#include<conio.h>
#include<sstream>
#include<time.h>
#include<vector> 
#include<stdio.h>
#include<stdlib.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0) 
using namespace std;
bool allowsave=1;
bool jiandang[21];//建立存档 
string nam,pas;
void console()
{
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);  
    CONSOLE_SCREEN_BUFFER_INFO bInfo; 
    GetConsoleScreenBufferInfo(hOut, &bInfo );  
    SetConsoleTitle("XACRAFT 3.4 简体中文版"); // 设置窗口的标题
}
struct han{
    int ui,num;
}hand[21][50],rl[51];
struct pflist{
    int num;
    han k[101];
    han sum;
}lis[10001],rlis[10001];
struct blocklist{
    string nam,ape;
    int pps,cor,hylink,maxl,mintim;
}bl[10001];
struct Eclist{
    string ecs,nam,notice;
    int jb,lin,emc;
}eclis[10001];
string tecpas,tecnam,tecpin;
char ch;
int errortimes=0;
string pfd="XZ";//皮肤 
long long jb=100;//金币数量 
int a[21][5][256][2049],x[21]={0},y[21],cx[21],cy[21],ran[21],mode[21],xuanze=0,lisn,rlisn,rln,eclisn,emc;
int smz[21],jed[21];
int days[21],tims[21],chuancan;
int i,j,kkk;
bool kn=0,echave[10001];
char cmmd;
string comd;
int seed;
bool bpf[51];
string pfs[10]={"XZ","XA","GD","MC","卍","◎","△","◇","□","∞"};
string waitingnotice[100]={
    "XACRAFT 1.0版本发布于2021年2月12日",
    "XACRAFT刚刚诞生时,代码行数不超过150行!",
    "金苹果的生成概率仅为0.05%",
    "你会发现,所有的XACRAFT生物群系都有植物生成!",
    "加入XACRAFT社区,与伙伴交流XACRAFT的游戏技巧!",
    "不要**近仙人掌!",
    "生存模式中,按下L键即可查看状态栏。",
    "饥饿值小于30时,生命值将不会恢复!",
    "多收集一些苹果,这样才不会挨饿。",
    "钻石矿石的生成最高高度为16。"
};
int pfp[10]={0,50,50,100,150,150,150,150,150,300},sehao=240,pfn=10;
int shop[21][21]=
{
    { 1,1,1,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,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,17,17,17,0,0,0,11,27,11,0,0,0,18,18,18,0,0,1 },
    { 1,0,0,17,6,17,0,0,0,11,27,11,0,0,0,18,15,18,0,0,1 },
    { 1,0,0,17,17,17,0,0,0,11,27,11,0,0,0,18,18,18,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,11,11,11,11,11,11,11,11,11,27,11,11,11,11,11,11,11,11,11,1 },
    { 1,27,27,27,27,27,27,27,27,27,7,27,27,27,27,27,27,27,27,27,1 },
    { 1,11,11,11,11,11,11,11,11,11,27,11,11,11,11,11,11,11,11,11,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,29,29,29,0,0,0,11,27,11,0,0,0,13,13,13,0,0,1 },
    { 1,0,0,29,28,29,0,0,0,11,27,11,0,0,0,13,14,13,0,0,1 },
    { 1,0,0,29,29,29,0,0,0,11,27,11,0,0,0,13,13,13,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
    { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
};
void color(int corcorcor){
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),corcorcor);
}
bool kd(char ccc){
    if(!KEY_DOWN(ccc)) return 0;
    else return 1;
}
int rdm(int aaaaa,int bbbbb){
    return rand()%(bbbbb-aaaaa+1)+aaaaa;
}
void cls(){//赟刑道提供,如有侵权请联系删除。    
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    COORD coordScreen = { 0, 0 };    // home for the cursor
    SetConsoleCursorPosition( hConsole, coordScreen );
}
char gl(){
    if(kd('Q')) return 'Q';
    if(kd('W')) return 'W';
    if(kd('E')) return 'E';
    if(kd('R')) return 'R';
    if(kd('T')) return 'T';
    if(kd('Y')) return 'Y';
    if(kd('U')) return 'U';
    if(kd('I')) return 'I';
    if(kd('O')) return 'O';
    if(kd('P')) return 'P';
    if(kd('A')) return 'A';
    if(kd('S')) return 'S';
    if(kd('D')) return 'D';
    if(kd('F')) return 'F';
    if(kd('G')) return 'G';
    if(kd('H')) return 'H';
    if(kd('J')) return 'J';
    if(kd('K')) return 'K';
    if(kd('L')) return 'L';
    if(kd('Z')) return 'Z';
    if(kd('X')) return 'X';
    if(kd('C')) return 'C';
    if(kd('V')) return 'V';
    if(kd('B')) return 'B';
    if(kd('N')) return 'N';
    if(kd('M')) return 'M';
    if(kd('1')) return '1';
    if(kd('2')) return '2';
    if(kd('3')) return '3';
    if(kd('4')) return '4';
    if(kd('5')) return '5';
    if(kd('6')) return '6';
    if(kd('7')) return '7';
    if(kd('8')) return '8';
    if(kd('9')) return '9';
    if(kd('0')) return '0';
}
string getTime(){//该函数如需借鉴请先联系沙兴安 
    time_t timep;
    time (&timep);
    char tmp[64];
    strftime(tmp, sizeof(tmp), "%m%d",localtime(&timep) );
    return tmp;
}
string GetTime(){//该函数如需借鉴请先联系沙兴安 
    time_t timep;
    time (&timep);
    char tmp[64];
    strftime(tmp, sizeof(tmp), "%Y%m%d",localtime(&timep) );
    return tmp;
}
int change_num(string will_change){//该函数如需借鉴请先联系沙兴安 
    stringstream sin;
    sin<<will_change;
    int change_ok;
    sin>>change_ok;
    return change_ok;
}
string change_string(int will_change){//该函数如需借鉴请先联系沙兴安 
    stringstream sin;
    sin<<will_change;
    string change_ok;
    sin>>change_ok;
    return change_ok;
}
void rightLine(string str){//该函数如需借鉴请先联系沙兴安 
    int i,l,w;
    w=80;
    l=str.length();
    for(i=0;i<80-l;i++)
    cout<<" ";
    cout<<str<<endl;
    return ;
}
void Line(string str){//该函数如需借鉴请先联系沙兴安 
    int i,l,w;
    w=80;
    l=str.length();
    for(i=0;i<(w-l)/2;i++)
    cout<<" ";
    cout<<str<<endl;
    return ;
}
void line(string str){//该函数如需借鉴请先联系沙兴安 
    int i,l,w;
    w=80;
    l=str.length();
    for(i=0;i<(w-l)/2;i++)
    cout<<" ";
    cout<<str;
    return ;
}
void jjsc(string str,int cor){//该函数如需借鉴请先联系沙兴安 
    system("cls");
    color(cor);
    system("cls");
    for(i=1;i<=11;i++) cout<<endl;
    color(cor);
    Line(str);
    color(7);
}
void del(int ccc,int uiui,int numm){
    for(i=1;i<=50;i++){
        if(uiui==hand[ccc][i].ui){
            hand[ccc][i].num-=numm;
            if(hand[ccc][i].num<=0){
                hand[ccc][i].num=0;
                hand[ccc][i].ui=0;
            }
            return ;
        }
    }
}
void pus(int ccc,int uiui,int numm){
    for(i=1;i<=50;i++){
        if(uiui==hand[ccc][i].ui && hand[ccc][i].num+numm<=bl[hand[ccc][i].ui].maxl){
            hand[ccc][i].num+=numm;
            return ;
        }
    }
    for(i=1;i<=50;i++){
        if(hand[ccc][i].ui==0){
            hand[ccc][i].ui=uiui;
            hand[ccc][i].num=numm;
            return ;
        }
    }
}
void waiting(string notice){
    system("cls");
    color(15);
    system("cls");
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    Line(notice);
    cout<<endl<<endl<<endl;
    Line("你知道吗?");
    cout<<endl;
    srand(time(NULL));
    Line(waitingnotice[rand()%10]);
}
void HideCursor1(){
    HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_CURSOR_INFO CursorInfo;
    GetConsoleCursorInfo(handle, &CursorInfo);//获取控制台光标信息
    CursorInfo.bVisible = false; //隐藏控制台光标
    SetConsoleCursorInfo(handle, &CursorInfo);//设置控制台光标状态
}
//逻辑锁部分(始)
bool end_day(){
    string tmp=GetTime(),temp="20220801";
    if(tmp>=temp) return 1;
    else return 0;
}
bool fool_days(){
    string tmp=getTime();
    if(tmp=="0401") return 1;
    else return 0;
} 
//逻辑锁部分(终) 
//TEC
void lin(string str){//该函数如需借鉴请先联系沙兴安 
    int i,l,w;
    w=80;
    l=str.length();
    for(i=0;i<(w-l)/2;i++)
    cout<<" ";
    cout<<str;
    return ;
}
void nameline(string str){
    int i,l,w;
    w=50;
    l=str.length();
    for(i=0;i<(w-l)/2-1;i++)
    cout<<" ";
    cout<<str;
    if((w-l)%2==0){
        for(i=0;i<(w-l)/2-1;i++)
        cout<<" ";
    }else{
        for(i=0;i<(w-l)/2;i++)
        cout<<" ";
    }
    color(7);
    cout<<"|";
    return ;
}
void passline(string str){
    int i,l,w;
    w=50;
    l=str.length();
    for(i=0;i<(w-l)/2-1;i++)
    cout<<" ";
    for(i=0;i<str.length();i++) cout<<"*";
    if((w-l)%2==0){
        for(i=0;i<(w-l)/2-1;i++)
        cout<<" ";
    }else{
        for(i=0;i<(w-l)/2;i++)
        cout<<" ";
    }
    color(7);
    cout<<"|";
    return ;
}
bool Login_getpass(){
    errortimes=0;
    cp:;
    if(errortimes>=3){
        color(13);
        cout<<endl;
        lin("错误次数过多,登录失败!");
        Sleep(3000);
        color(7);
        return 0;
    }
    tecpin="";
    ch=0;
    while(ch!=13){
        system("cls");
        color(14);
        cout<<endl;
        lin("登录 TEC 账号");
        printf("\n\n\n\n\n\n");
        color(7);
        cout<<endl;
        lin("==================================================");
        cout<<endl;
        cout<<"               |";
        color(11);
        nameline("欢迎回来,"+tecnam);
        cout<<endl;
        lin("==================================================");
        printf("\n\n\n");
        color(10);
        cout<<"               >>输入密码";
        color(7);
        cout<<endl;
        lin("==================================================");
        cout<<endl;
        cout<<"               |";
        passline(tecpin);
        cout<<endl;
        lin("==================================================");
        ch=_getch();
        tecpin+=ch;
        if(ch==8){
            tecpin=tecpin.substr(0,tecpin.length()-1);
            tecpin=tecpin.substr(0,tecpin.length()-1);
        }
    }
    stringstream in1;
    in1<<tecpin;
    in1>>tecpin;
    if(tecpin!=tecpas){
        cout<<endl;
        color(12);
        lin("密码错误");
        errortimes++;
        Sleep(1500);
        goto cp;
    }
    system("cls");
    return 1;
} 
void getnam(){
    tecpin="";
    ch=0;
    while(ch!=13){
        system("cls");
        color(14);
        cout<<endl;
        lin("注册 TEC 账号");
        printf("\n\n\n\n\n\n");
        color(10);
        cout<<"               >>用户名";
        color(15);
        cout<<"  {请输入}"; 
        if(tecpin.length()>45){
            color(12);
            cout<<"   用户名过长";
            tecpin=tecpin.substr(0,tecpin.length()-1);
        }
        color(7);
        cout<<endl;
        lin("==================================================");
        cout<<endl;
        cout<<"               |";
        nameline(tecpin);
        cout<<endl;
        lin("==================================================");
        printf("\n\n\n");
        color(10);
        cout<<"               >>密码";
        color(7);
        cout<<endl;
        lin("==================================================");
        cout<<endl;
        cout<<"               |                                                |";
        cout<<endl;
        lin("==================================================");
        ch=_getch();
        tecpin+=ch;
        if(ch==8){
            tecpin=tecpin.substr(0,tecpin.length()-1);
            tecpin=tecpin.substr(0,tecpin.length()-1);
        }
    }
    system("cls");
    stringstream in1;
    in1<<tecpin;
    in1>>tecnam;
    if(tecnam.length()==0) getnam();
    return ;
}
void getpas(){
    tecpin="";
    ch=0;
    while(ch!=13){
        system("cls");
        color(14);
        cout<<endl;
        lin("注册 TEC 账号");
        printf("\n\n\n\n\n\n");
        color(10);
        cout<<"               >>用户名 输入完成 √";
        color(7);
        cout<<endl;
        lin("==================================================");
        cout<<endl;
        cout<<"               |";
        nameline(tecnam);
        cout<<endl;
        lin("==================================================");
        printf("\n\n\n");
        color(10);
        cout<<"               >>密码";
        color(15);
        cout<<"  {请输入}"; 
        if(tecpin.length()>45){
            color(12);
            cout<<"   密码过长";
            tecpin=tecpin.substr(0,tecpin.length()-1);
        }
        color(7);
        cout<<endl;
        lin("==================================================");
        cout<<endl;
        cout<<"               |";
        passline(tecpin);
        cout<<endl;
        lin("==================================================");
        ch=_getch();
        tecpin+=ch;
        if(ch==8){
            tecpin=tecpin.substr(0,tecpin.length()-1);
            tecpin=tecpin.substr(0,tecpin.length()-1);
        }
    }
    system("cls");
    tecpas=tecpin;
    if(tecpas.length()==0) getpas();
    return ;
}
void TEClogin(){
    ifstream fin("TEC账户.tecdata");
    fin>>tecnam>>tecpas;
    fin.close();
    if(tecnam.length()!=0 && tecpas.length()!=0){
        if(Login_getpass()==0){
            i=0;
            cout<<0/i;
        }
        return ;
    } 
    getnam();
    getpas();   
    ofstream fout("TEC账户.tecdata");
    fout<<tecnam<<endl<<tecpas;
    fout.close();
    return ;    
}
//TEC
void sav(){
    if(allowsave){
    waiting("正在保存您的数据,请耐心等待");
    ofstream fout("XACRAFT存档文件.xadata");
    fout<<1<<endl;
    for(i=1;i<=20;i++) fout<<jiandang[i]<<" ";
    fout<<endl;
    for(i=1;i<=20;i++){
        for(j=1;j<=49;j++){
            fout<<hand[i][j].ui<<" "<<hand[i][j].num<<" ";
        }
        fout<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<mode[i]<<" ";
    }
    fout<<endl;
    fout<<pfd<<endl;
    fout<<jb<<" "<<emc<<endl;
    for(int iii=1;iii<=20;iii++){
        for(int jjj=1;jjj<=4;jjj++){
            for(int kkk=1;kkk<=255;kkk++){
                for(int lll=1;lll<=2048;lll++){
                    fout<<a[iii][jjj][kkk][lll]<<" ";
                }
                fout<<endl;
            }
        }
    }
    for(i=1;i<=20;i++){
        fout<<x[i]<<" "<<y[i]<<" "<<cx[i]<<" "<<cy[i]<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<smz[i]<<" "<<jed[i]<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<ran[i]<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<days[i]<<" "<<tims[i]<<endl;
    }
    for(i=1;i<=50;i++){
        fout<<bpf[i]<<endl;
    }
    fout<<sehao;
    fout.close();
    }
}
void rea(){
    if(allowsave){
    waiting("正在读取您的数据,请耐心等待");
    ifstream fin("XACRAFT存档文件.xadata");
    fin>>i;
    for(i=1;i<=20;i++) fin>>jiandang[i];
    for(i=1;i<=20;i++){
        for(j=1;j<=49;j++){
            fin>>hand[i][j].ui>>hand[i][j].num;
        }
    }
    for(i=1;i<=20;i++){
        fin>>mode[i];
    }
    fin>>pfd;
    fin>>jb>>emc;
    for(int iii=1;iii<=20;iii++){
        for(int jjj=1;jjj<=4;jjj++){
            for(int kkk=1;kkk<=255;kkk++){
                for(int lll=1;lll<=2048;lll++){
                    fin>>a[iii][jjj][kkk][lll];
                }
            }
        }
    }
    for(i=1;i<=20;i++){
        fin>>x[i]>>y[i]>>cx[i]>>cy[i];
    }
    for(i=1;i<=20;i++){
        fin>>smz[i]>>jed[i];
    }
    for(i=1;i<=20;i++){
        fin>>ran[i];
    }
    for(i=1;i<=20;i++){
        fin>>days[i]>>tims[i];
    }
    for(i=1;i<=50;i++){
        fin>>bpf[i];
    }
    fin>>sehao;
    fin.close();    
    }
}
void checkcun(){
    if(allowsave){
    ifstream fin("XACRAFT存档文件.xadata");
    fin>>i;
    fin.close();
    if(i!=0) return ;
    ofstream fout("XACRAFT存档文件.xadata");
    waiting("检测到第一次登录,正在新建存档");
    fout<<1<<endl;
    for(i=1;i<=20;i++) fout<<0<<" ";
    fout<<endl;
    for(i=1;i<=20;i++){
        for(j=1;j<=49;j++){
            fout<<0<<" "<<0<<" ";
        }
        fout<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<0<<" ";
    }
    fout<<endl;
    fout<<"XZ"<<endl;
    fout<<100<<" "<<0<<endl;
    for(int iii=1;iii<=20;iii++){
        for(int jjj=1;jjj<=4;jjj++){
            for(int kkk=1;kkk<=255;kkk++){
                for(int lll=1;lll<=2048;lll++){
                    fout<<0<<" ";
                }
                fout<<endl;
            }
        }
    }
    for(i=1;i<=20;i++){
        fout<<0<<" "<<0<<" "<<0<<" "<<0<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<0<<" "<<0<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<0<<endl;
    }
    for(i=1;i<=20;i++){
        fout<<0<<" "<<0<<endl;
    }
    fout<<1<<endl;
    for(i=2;i<=50;i++){
        fout<<0<<endl;
    }
    fout<<240;
    fout.close();
    return ;
    }
}
void ppf(int cor){
    color(cor);
    cout<<pfd;
    color(7);
}
string XAPin(string s){//该函数如需借鉴请先联系沙兴安 
    int sn=min((int)s.size()+64,90),kn=(int)s.size();
    int pin[256];
    string sp;
    for(int i=0;i<s.size()-1;i++){
        pin[i]=(int)(s[i]+s[i+1])/2;
    }
    for(int i=0;i<s.size();i++){
        if(kn%2==(int)pin[i]%3) sp+=(char)(min((int)sn+i*2,127));
        sp+=(char)pin[i];
    }
    return sp;
}
void Logical_Lock(){//该函数如需借鉴请先联系沙兴安 
    if(fool_days()){
        system("cls");
        color(252);
        system("cls");
        cout<<endl;
        Line("恭喜你");
        cout<<endl<<endl;
        color(240);
        Line("您获得了豪华大礼包,兑换码:AprilFoolDay");
        cmmd=getch();
    }
}
void centerlink(int cor){
    if(bl[cor].hylink==1){
        color(chuancan+bl[cor].cor);
        cout<<bl[cor].ape;
    }
}
string wri(int cor){
    return bl[cor].nam;
}
int print(int cor){
    if(bl[cor].hylink!=0) centerlink(cor);
    else{
        color(bl[cor].cor);
        cout<<bl[cor].ape;  
    }
}
void lists(){
    //bl[].ape="",bl[].cor=,bl[].nam="",bl[].pps=,bl[].hylink=,bl[].maxl=,bl[].mintim=;
    bl[0].ape="  ",bl[0].cor=0,bl[0].nam="空气方块",bl[0].pps=0,bl[0].hylink=1,bl[0].maxl=32767,bl[0].mintim=0;
    bl[1].ape="  ",bl[1].cor=170,bl[1].nam="草方块",bl[1].pps=0,bl[1].hylink=0,bl[1].maxl=64,bl[1].mintim=500;
    bl[2].ape="  ",bl[2].cor=34,bl[2].nam="树叶",bl[2].pps=0,bl[2].hylink=0,bl[2].maxl=64,bl[2].mintim=200;
    bl[3].ape="  ",bl[3].cor=136,bl[3].nam="石头",bl[3].pps=0,bl[3].hylink=0,bl[3].maxl=64,bl[3].mintim=2000;
    bl[4].ape="  ",bl[4].cor=102,bl[4].nam="泥土",bl[4].pps=0,bl[4].hylink=0,bl[4].maxl=64,bl[4].mintim=500;
    bl[5].ape="",bl[5].cor=0,bl[5].nam="",bl[5].pps=0,bl[5].hylink=0,bl[5].maxl=0,bl[5].mintim=0;
    bl[6].ape="WO",bl[6].cor=96,bl[6].nam="橡木原木",bl[6].pps=0,bl[6].hylink=0,bl[6].maxl=64,bl[6].mintim=1000;
    bl[7].ape="::",bl[7].cor=139,bl[7].nam="钻石矿石",bl[7].pps=0,bl[7].hylink=0,bl[7].maxl=64,bl[7].mintim=2500;
    bl[8].ape="::",bl[8].cor=142,bl[8].nam="黄金矿石",bl[8].pps=0,bl[8].hylink=0,bl[8].maxl=64,bl[8].mintim=2500;
    bl[9].ape="AP",bl[9].cor=207,bl[9].nam="苹果",bl[9].pps=1,bl[9].hylink=0,bl[9].maxl=16,bl[9].mintim=200;
    bl[10].ape="GA",bl[10].cor=239,bl[10].nam="金苹果",bl[10].pps=1,bl[10].hylink=0,bl[10].maxl=1,bl[10].mintim=200;
    bl[11].ape="  ",bl[11].cor=238,bl[11].nam="沙子",bl[11].pps=0,bl[11].hylink=0,bl[11].maxl=64,bl[11].mintim=500;
    bl[12].ape="==",bl[12].cor=239,bl[12].nam="砂岩",bl[12].pps=0,bl[12].hylink=0,bl[12].maxl=64,bl[12].mintim=2000;
    bl[13].ape="##",bl[13].cor=127,bl[13].nam="雪块",bl[13].pps=0,bl[13].hylink=0,bl[13].maxl=64,bl[13].mintim=500;
    bl[14].ape="::",bl[14].cor=32,bl[14].nam="仙人掌",bl[14].pps=0,bl[14].hylink=0,bl[14].maxl=64,bl[14].mintim=200;
    bl[15].ape="BR",bl[15].cor=112,bl[15].nam="白桦原木",bl[15].pps=0,bl[15].hylink=0,bl[15].maxl=64,bl[15].mintim=1000;
    bl[16].ape="HW",bl[16].cor=31,bl[16].nam="HelloWorld",bl[16].pps=0,bl[16].hylink=0,bl[16].maxl=1,bl[16].mintim=0;
    bl[17].ape="==",bl[17].cor=96,bl[17].nam="橡木木板",bl[17].pps=0,bl[17].hylink=0,bl[17].maxl=64,bl[17].mintim=1000;
    bl[18].ape="==",bl[18].cor=126,bl[18].nam="白桦木板",bl[18].pps=0,bl[18].hylink=0,bl[18].maxl=64,bl[18].mintim=1000;
    bl[19].ape="//",bl[19].cor=6,bl[19].nam="木棍堆",bl[19].pps=1,bl[19].hylink=1,bl[19].maxl=64,bl[19].mintim=200;
    bl[20].ape="##",bl[20].cor=128,bl[20].nam="熔炉",bl[20].pps=0,bl[20].hylink=0,bl[20].maxl=64,bl[20].mintim=500;
    bl[21].ape="::",bl[21].cor=128,bl[21].nam="煤矿石",bl[21].pps=0,bl[21].hylink=0,bl[21].maxl=64,bl[21].mintim=2500;
    bl[22].ape="▃",bl[22].cor=0,bl[22].nam="煤炭",bl[22].pps=1,bl[22].hylink=1,bl[22].maxl=64,bl[22].mintim=0;
    bl[23].ape="▃",bl[23].cor=14,bl[23].nam="金锭",bl[23].pps=1,bl[23].hylink=1,bl[23].maxl=64,bl[23].mintim=0;
    bl[24].ape="▃",bl[24].cor=11,bl[24].nam="钻石",bl[24].pps=1,bl[24].hylink=1,bl[24].maxl=64,bl[24].mintim=0;
    bl[25].ape="□",bl[25].cor=15,bl[25].nam="煤炭块",bl[25].pps=0,bl[25].hylink=0,bl[25].maxl=64,bl[25].mintim=2000;
    bl[26].ape="□",bl[26].cor=239,bl[26].nam="金块",bl[26].pps=0,bl[26].hylink=0,bl[26].maxl=64,bl[26].mintim=3000;
    bl[27].ape="□",bl[27].cor=191,bl[27].nam="钻石块",bl[27].pps=0,bl[27].hylink=0,bl[27].maxl=64,bl[27].mintim=5000;
    bl[28].ape="SP",bl[28].cor=96,bl[28].nam="云杉原木",bl[28].pps=0,bl[28].hylink=0,bl[28].maxl=64,bl[28].mintim=1000;
    bl[29].ape="--",bl[29].cor=96,bl[29].nam="云杉木板",bl[29].pps=0,bl[29].hylink=0,bl[29].maxl=64,bl[29].mintim=1000;
    bpf[0]=1;
    lisn=14,rlisn=3,rln=8,eclisn=14;
    //lis[x].num=a,lis[x].k[y].num=a,lis[x].k[y].ui=a,lis[x].sum.num=a,lis[x].sum.ui=a;
    lis[0].num=2,lis[0].k[1].num=1,lis[0].k[1].ui=1,lis[0].k[2].num=1,lis[0].k[2].ui=2,lis[0].sum.num=1,lis[0].sum.ui=16;
    lis[1].num=1,lis[1].k[1].num=1,lis[1].k[1].ui=6,lis[1].sum.num=4,lis[1].sum.ui=17;
    lis[2].num=1,lis[2].k[1].num=1,lis[2].k[1].ui=15,lis[2].sum.num=4,lis[2].sum.ui=18;
    lis[3].num=1,lis[3].k[1].num=2,lis[3].k[1].ui=17,lis[3].sum.num=4,lis[3].sum.ui=19;
    lis[4].num=1,lis[4].k[1].num=2,lis[4].k[1].ui=18,lis[4].sum.num=4,lis[4].sum.ui=19;
    lis[5].num=1,lis[5].k[1].num=8,lis[5].k[1].ui=3,lis[5].sum.num=1,lis[5].sum.ui=20;
    lis[6].num=1,lis[6].k[1].num=9,lis[6].k[1].ui=22,lis[6].sum.num=1,lis[6].sum.ui=25;
    lis[7].num=1,lis[7].k[1].num=1,lis[7].k[1].ui=25,lis[7].sum.num=9,lis[7].sum.ui=22;
    lis[8].num=1,lis[8].k[1].num=9,lis[8].k[1].ui=23,lis[8].sum.num=1,lis[8].sum.ui=26;
    lis[9].num=1,lis[9].k[1].num=1,lis[9].k[1].ui=26,lis[9].sum.num=9,lis[9].sum.ui=23;
    lis[10].num=1,lis[10].k[1].num=9,lis[10].k[1].ui=24,lis[10].sum.num=1,lis[10].sum.ui=27;
    lis[11].num=1,lis[11].k[1].num=1,lis[11].k[1].ui=27,lis[11].sum.num=9,lis[11].sum.ui=24;
    lis[12].num=2,lis[12].k[1].num=8,lis[12].k[1].ui=23,lis[12].k[2].num=1,lis[12].k[2].ui=9,lis[12].sum.num=1,lis[12].sum.ui=10;
    lis[13].num=1,lis[13].k[1].num=1,lis[13].k[1].ui=28,lis[13].sum.num=4,lis[13].sum.ui=29;
    lis[14].num=1,lis[14].k[1].num=2,lis[14].k[1].ui=29,lis[14].sum.num=4,lis[14].sum.ui=19;
    //rlis[x].num=1,rlis[x].k[1].num=1,rlis[x].k[1].ui=a,rlis[x].sum.num=1,rlis[x].sum.ui=a;
    rlis[1].num=1,rlis[1].k[1].num=1,rlis[1].k[1].ui=21,rlis[1].sum.num=1,rlis[1].sum.ui=22;
    rlis[2].num=1,rlis[2].k[1].num=1,rlis[2].k[1].ui=8,rlis[2].sum.num=1,rlis[2].sum.ui=23;
    rlis[3].num=1,rlis[3].k[1].num=1,rlis[3].k[1].ui=7,rlis[3].sum.num=1,rlis[3].sum.ui=24;
    //rl[x].num=a,rl[x].ui=a;
    rl[1].num=4,rl[1].ui=6;
    rl[2].num=4,rl[2].ui=15;
    rl[3].num=2,rl[3].ui=17;
    rl[4].num=2,rl[4].ui=18;
    rl[5].num=1,rl[5].ui=19;
    rl[6].num=8,rl[6].ui=22;
    rl[7].num=4,rl[7].ui=28;
    rl[8].num=2,rl[8].ui=29;
    //eclis[1].ecs="",eclis[1].nam="",eclis[1].notice,eclis[1].jb=,eclis[].emc=,eclis[1].lin=0;
    eclis[1].ecs="LTBJICMYPUmsnjfbmplrHt",eclis[1].nam="XACRAFT一周年纪念礼",eclis[1].notice="XACRAFT一年,一路有你相伴!",eclis[1].jb=100,eclis[1].emc=100,eclis[1].lin=0;
    eclis[2].ecs="FJUXeUPq\\\\",eclis[2].nam="CIL 2021-Win 一级礼",eclis[2].notice="感谢您对CIL系列赛事的支持!",eclis[2].jb=20,eclis[2].emc=10,eclis[2].lin=0;
    eclis[3].ecs="FJU[\\IPqZf\\",eclis[3].nam="CIL 2021-Win 二级礼",eclis[3].notice="感谢您对CIL系列赛事的支持!",eclis[3].jb=50,eclis[3].emc=30,eclis[3].lin=0;
    eclis[4].ecs="FJUR[RVNmb\\",eclis[4].nam="CIL 2021-Win 三级礼",eclis[4].notice="感谢您对CIL系列赛事的支持!",eclis[4].jb=80,eclis[4].emc=50,eclis[4].lin=0;
    eclis[5].ecs="FJUXeVVTkR\\",eclis[5].nam="CIL 2021-Win 四级礼",eclis[5].notice="感谢您对CIL系列赛事的支持!",eclis[5].jb=100,eclis[5].emc=80,eclis[5].lin=0;
    eclis[6].ecs="FJUYRcTTVWqZ`\\",eclis[6].nam="CIL 2021-Win 五级礼",eclis[6].notice="感谢您对CIL系列赛事的支持!",eclis[6].jb=150,eclis[6].emc=100,eclis[6].lin=0;
    eclis[7].ecs="MLRLPTNPMZ0\\",eclis[7].nam="HSE 一等奖励",eclis[7].notice="感谢您对HSE系列赛事的支持!",eclis[7].jb=60,eclis[7].lin=0;
    eclis[8].ecs="MLRPKRQOVQS4\\",eclis[8].nam="HSE 二等奖励",eclis[8].notice="感谢您对HSE系列赛事的支持!",eclis[8].jb=30,eclis[8].lin=0;
    eclis[9].ecs="MLRPHSRLXN2\\",eclis[9].nam="HSE 三等奖励",eclis[9].notice="感谢您对HSE系列赛事的支持!",eclis[9].jb=10,eclis[9].lin=0;
    eclis[10].ecs="OOSLPTNPMZ0\\",eclis[10].nam="FXGF--FS 一等奖励",eclis[10].notice="感谢您对FXGF--FS系列赛事的支持!",eclis[10].jb=80,eclis[10].lin=0;
    eclis[11].ecs="OOSPKRQOVQS4\\",eclis[11].nam="FXGF--FS 二等奖励",eclis[11].notice="感谢您对FXGF--FS系列赛事的支持!",eclis[11].jb=50,eclis[11].lin=0;
    eclis[12].ecs="OOSPHSRLXN2\\",eclis[12].nam="FXGF--FS 三等奖励",eclis[12].notice="感谢您对FXGF--FS系列赛事的支持!",eclis[12].jb=30,eclis[12].lin=0;
    eclis[13].ecs="apVrXuZlPXqmjYhZjomXRm ",eclis[13].nam="愚人节补偿",eclis[13].notice="非常抱歉愚人节彩蛋给你带来的损失,已双倍归还。",eclis[13].jb=20,eclis[13].emc=20,eclis[13].lin=0;
    eclis[14].ecs="XqmjYVZXomXRmb",eclis[14].nam="愚人节大礼包",eclis[14].notice="惊喜不惊喜?意外不意外?",eclis[14].jb=-10,eclis[14].emc=-10,eclis[14].lin=0;
    return ;
}
void print_packback(int com,int xuanz){
    color(7);
        cout<<endl<<"\t\t\t   ";
        for(i=1;i<=9;i++){
            if(hand[com][i].num!=0){
                print(hand[com][i].ui);
            }else{
                cout<<"□";
            }
            color(7);
            printf(" ");
        }
        color(7);
        cout<<endl<<"\t\t\t   ";
        for(i=1;i<=9;i++){
            if(i==xuanz) color(11);
            else color(7);
            if(hand[com][i].num!=0){
                if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
                else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
                else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
                else cout<<hand[com][i].num%10000/1000<<"^";
            }else{
                cout<<"--";
            }
            color(7);
            printf(" ");
        }
        color(7);
        cout<<endl<<"\t\t\t   ";
        for(i=10;i<=18;i++){
            color(7);
            if(hand[com][i].num!=0){
                print(hand[com][i].ui);
            }else{
                cout<<"□";
            }
            color(7);
            printf(" ");
        }
        color(7);
        cout<<endl<<"\t\t\t   ";
        for(i=10;i<=18;i++){
            if(i==xuanz) color(11);
            else color(7);
            if(hand[com][i].num!=0){
                if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
                else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
                else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
                else cout<<hand[com][i].num%10000/1000<<"^";
            }else{
                cout<<"--";
            }
            color(7);
            printf(" ");
        }
        color(7);
        cout<<endl<<"\t\t\t   ";
        for(i=19;i<=27;i++){
            color(7);
            if(hand[com][i].num!=0){
                print(hand[com][i].ui);
            }else{
                cout<<"□";
            }
            color(7);
            printf(" ");
        }
        color(7);
        cout<<endl<<"\t\t\t   ";
        for(i=19;i<=27;i++){
            if(i==xuanz) color(11);
            else color(7);
            if(hand[com][i].num!=0){
                if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
                else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
                else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
                else cout<<hand[com][i].num%10000/1000<<"^";
            }else{
                cout<<"--";
            }
            color(7);
            printf(" ");
        }
}
bool che(int ccc,int uiui,int numm){
    for(int oooo=1;oooo<=50;oooo++){
        if(uiui==hand[ccc][oooo].ui && (hand[ccc][oooo].num<numm || hand[ccc][oooo].num==0)){
            return false;
        }
    }
    for(int oooo=1;oooo<=50;oooo++){
        if(uiui==hand[ccc][oooo].ui){
            return true;
        }
    }
    return false;
}
bool jian(int ccc,int cho){
    bool flag=true;
    for(int oo=1;oo<=lis[cho].num;oo++){
        flag=(che(ccc,lis[cho].k[oo].ui,lis[cho].k[oo].num) && flag);
        if(!flag) break;
    }
    return flag;
}
void craftingtable(int com){
    for(int oo=1;oo<=50;oo++){
        if(hand[com][oo].num==0){
            hand[com][oo].num=0;
            hand[com][oo].ui=0;
        }
    }
    int xuanz=1;
    while(cmmd!='E' && cmmd!='e'){  
        cmmd='?';
        system("cls");
        color(14);
        Line("工作台");
        print_packback(com,-1);
        cout<<endl;
        Line("W/S-切换     Q-合成     E-退出");
        color(10);
        Line(wri(lis[xuanz].sum.ui));
        color(7);
        for(i=max(xuanz-8,1);i<=min(lisn,xuanz+8);i++){
            if(i==xuanz) cout<<"   > ";
            else cout<<"     ";
            if(jian(com,i)){
                color(10);
                cout<<" √  ";
            }else{
                color(12);
                cout<<" ×  ";
            }
            print(lis[i].sum.ui);
            color(7);
            cout<<"*";
            printf("%02d",lis[i].sum.num);
            color(7);
            cout<<" = ";
            print(lis[i].k[1].ui);
            color(7);
            cout<<"*";
            printf("%02d",lis[i].k[1].num);
            for(j=2;j<=lis[i].num;j++){
                color(7);
                cout<<"+";
                print(lis[i].k[j].ui);
                color(7);
                cout<<"*";
                printf("%02d",lis[i].k[j].num); 
            }
            cout<<endl;
        }
        cmmd=getch();
        if(cmmd=='W' || cmmd=='w'){
            xuanz--;
        }
        if(cmmd=='S' || cmmd=='s'){
            xuanz++;
        }
        if(xuanz<=0 || xuanz>lisn) xuanz=1;
        if(cmmd=='Q' || cmmd=='q'){
            if(jian(com,xuanz)){
                for(j=1;j<=lis[xuanz].num;j++){
                    del(com,lis[xuanz].k[j].ui,lis[xuanz].k[j].num);
                }
                pus(com,lis[xuanz].sum.ui,lis[xuanz].sum.num);
            }
        }
    }
    cmmd='?';
    return ;
}
bool rjian(int ccc,int cho){
    bool flag=true;
    for(int oo=1;oo<=rlis[cho].num;oo++){
        flag=(che(ccc,rlis[cho].k[oo].ui,rlis[cho].k[oo].num) && flag);
        if(!flag) break;
    }
    return flag;
}
void furnace(int com){
    cmmd='?';
    for(int oo=1;oo<=50;oo++){
        if(hand[com][oo].num==0){
            hand[com][oo].num=0;
            hand[com][oo].ui=0;
        }
    }
    int xuanz=1;
    while(cmmd!='E' && cmmd!='e'){  
        cmmd='?';
        system("cls");
        color(14);
        Line("熔炉");
        print_packback(com,-1);
        cout<<endl;
        Line("W/S-切换     Q-冶炼     R-添加燃料     E-退出");
        cout<<"           燃料:"<<ran[com]<<endl;
        color(10);
        Line(wri(rlis[xuanz].sum.ui));
        color(7);
        for(i=max(xuanz-8,1);i<=min(rlisn,xuanz+8);i++){
            if(i==xuanz) cout<<"   > ";
            else cout<<"     ";
            if(rjian(com,i)){
                if(ran[com]==0){
                    color(14);
                    cout<<" ○  "; 
                }else{
                    color(10);
                    cout<<" √  ";   
                }
            }else{
                color(12);
                cout<<" ×  ";
            }
            print(rlis[i].sum.ui);
            color(7);
            cout<<"*";
            printf("%02d",rlis[i].sum.num);
            color(7);
            cout<<" = ";
            print(rlis[i].k[1].ui);
            color(7);
            cout<<"*";
            printf("%02d",rlis[i].k[1].num);
            for(j=2;j<=rlis[i].num;j++){
                color(7);
                cout<<"+";
                print(rlis[i].k[j].ui);
                color(7);
                cout<<"*";
                printf("%02d",rlis[i].k[j].num);    
            }
            cout<<endl;
        }
        cmmd=getch();
        if(cmmd=='W' || cmmd=='w'){
            xuanz--;
        }
        if(cmmd=='S' || cmmd=='s'){
            xuanz++;
        }
        if(cmmd=='R' || cmmd=='r'){
            int xuanze=1;
            while(cmmd!='E' && cmmd!='e'){
                system("cls");
                color(14);
                Line("添加燃料");
                print_packback(com,-1);
                cout<<endl;
                Line("W/S-切换     Q-添加     E-退出");
                color(7);
                cout<<"          燃料:"<<wri(rl[xuanze].ui)<<endl;
                for(i=max(xuanze-8,1);i<=min(rln,xuanze+8);i++){
                    if(i==xuanze) cout<<"   > ";
                    else cout<<"     ";
                    if(che(com,rl[i].ui,1)){
                        color(10);
                        cout<<" √  ";   
                    }else{
                        color(12);
                        cout<<" ×  ";
                    }
                    print(rl[i].ui);
                    color(7);
                    cout<<endl;
                }
                cmmd=getch();
                if(cmmd=='W' || cmmd=='w'){
                    xuanze--;
                }
                if(cmmd=='S' || cmmd=='s'){
                    xuanze++;
                }
                if(xuanze<=0 || xuanze>rln) xuanze=1;
                if(cmmd=='Q' || cmmd=='q'){
                    if(che(com,rl[xuanze].ui,1)){
                        del(com,rl[xuanze].ui,1);
                        ran[com]+=rl[xuanze].num;
                    }
                }
            }
            cmmd='?';
        }
        if(xuanz<=0 || xuanz>rlisn) xuanz=1;
        if(cmmd=='Q' || cmmd=='q'){
            if(rjian(com,xuanz) && ran[com]>=1){
                ran[com]--;
                for(j=1;j<=rlis[xuanz].num;j++){
                    del(com,rlis[xuanz].k[j].ui,rlis[xuanz].k[j].num);
                }
                pus(com,rlis[xuanz].sum.ui,rlis[xuanz].sum.num);
            }
        }
    }
    cmmd='?';
    return ;
}
void packback(int com){
    while(kd('E')){
    }
    cmmd='?';
    while(cmmd!='E' && cmmd!='e'){
        cmmd=getch();
    }
    int xuanz=xuanze;
    cmmd='?';
    while(cmmd!='E' && cmmd!='e'){  
        cmmd='?';
        system("cls");
        color(14);
        Line("背包");
        print_packback(com,xuanz);
        cout<<endl;
        Line(" G-交换   H-合成   E-退出");
        cmmd=getch();
        if(cmmd=='W' || cmmd=='w'){
            if(xuanz<=9) xuanz+=18;
            else xuanz-=9;
        }
        if(cmmd=='A' || cmmd=='a'){
            if(xuanz%9==1) xuanz+=8;
            else xuanz-=1;
        }
        if(cmmd=='S' || cmmd=='s'){
            if(xuanz>=19) xuanz-=18;
            else xuanz+=9;
        }
        if(cmmd=='D' || cmmd=='d'){
            if(xuanz%9==0) xuanz-=8;
            else xuanz+=1;
        }
        if(cmmd=='G' || cmmd=='g'){
            int xuz1=1,xuz2=1;
            while(cmmd!='P' && cmmd!='p'){  
                system("cls");
                color(14);
                Line("选择您需要交换的物品1 (Q-确认  P-退出)");
                print_packback(com,xuz1);
                cmmd=getch();
                if(cmmd=='W' || cmmd=='w'){
                    if(xuz1<=9) xuz1+=18;
                    else xuz1-=9;
                }
                if(cmmd=='A' || cmmd=='a'){
                    if(xuz1%9==1) xuz1+=8;
                    else xuz1-=1;
                }
                if(cmmd=='S' || cmmd=='s'){
                    if(xuz1>=19) xuz1-=18;
                    else xuz1+=9;
                }
                if(cmmd=='D' || cmmd=='d'){
                    if(xuz1%9==0) xuz1-=8;
                    else xuz1+=1;
                }
                if(cmmd=='Q' || cmmd=='q') break;
            }
            while(cmmd!='P' && cmmd!='p'){  
                system("cls");
                color(14);
                Line("选择您需要交换的物品2 (Q-确认  P-退出)");
                print_packback(com,xuz2);
                cmmd=getch();
                if(cmmd=='W' || cmmd=='w'){
                    if(xuz2<=9) xuz2+=18;
                    else xuz2-=9;
                }
                if(cmmd=='A' || cmmd=='a'){
                    if(xuz2%9==1) xuz2+=8;
                    else xuz2-=1;
                }
                if(cmmd=='S' || cmmd=='s'){
                    if(xuz2>=19) xuz2-=18;
                    else xuz2+=9;
                }
                if(cmmd=='D' || cmmd=='d'){
                    if(xuz2%9==0) xuz2-=8;
                    else xuz2+=1;
                }
                if(cmmd=='Q' || cmmd=='q') break;
            }
            if(cmmd!='P' && cmmd!='p'){
                int aaa=hand[com][xuz1].num,bbb=hand[com][xuz1].ui;
                hand[com][xuz1].num=hand[com][xuz2].num;
                hand[com][xuz1].ui=hand[com][xuz2].ui;
                hand[com][xuz2].num=aaa;
                hand[com][xuz2].ui=bbb;
            }
        }
        if(cmmd=='H' || cmmd=='h') craftingtable(com);
        //if(cmmd=='J' || cmmd=='j') furnace(com);
    }
    cmmd='?';
    for(int oo=1;oo<=50;oo++){
        if(hand[com][oo].num==0){
            hand[com][oo].num=0;
            hand[com][oo].ui=0;
        }
    }
    return ;
}
void handand(int ccc,int xxx){
    if(bl[hand[ccc][xxx].ui].maxl==hand[ccc][xxx].num){
        for(i=1;i<=50;i++){
            if(hand[ccc][i].num<bl[hand[ccc][xxx].ui].maxl && hand[ccc][xxx].ui==hand[ccc][i].ui){
                hand[ccc][i].num++;
                return ;
            }
        }
        for(i=1;i<=50;i++){
            if(hand[ccc][i].ui==0){
                hand[ccc][i].ui=hand[ccc][xxx].ui;
                hand[ccc][i].num++;
                return ;
            }
        }
    }else{
        hand[ccc][xxx].num++;
    }
}
void pt(int ccc,int jjj,int xxx,int yyy,bool dq){
    if(!dq){//na
        if(a[ccc][jjj][xxx][yyy]!=0){
            //Sleep(bl[a[ccc][jjj][xxx][yyy]].mintim);
            if(mode[ccc]==1){
                int timew=0;
                while(kd('Y') || kd('U') || kd('I') || kd('H') || kd('K') || kd('B') || kd('N') || kd('M')){
                    //cout<<timew;
                    timew++;
                    Sleep(1);
                    if(timew*100>=bl[a[ccc][jjj][xxx][yyy]].mintim) break;
                }
                if(timew*100<bl[a[ccc][jjj][xxx][yyy]].mintim) return ; 
            }
            for(i=1;i<=50;i++){
                if(a[ccc][jjj][xxx][yyy]==hand[ccc][i].ui){
                    handand(ccc,i);
                    a[ccc][jjj][xxx][yyy]=0;
                    return ;
                }
            }
            for(i=1;i<=50;i++){
                if(hand[ccc][i].ui==0){
                    hand[ccc][i].ui=a[ccc][jjj][xxx][yyy];
                    handand(ccc,i);
                    a[ccc][jjj][xxx][yyy]=0;
                    return ;
                }
            }
        }
        return ;
    }else if(dq){//fang
        if(a[ccc][jjj][xxx][yyy]==0 && hand[ccc][xuanze].num!=0 && bl[hand[ccc][xuanze].ui].pps==0){
            a[ccc][jjj][xxx][yyy]=hand[ccc][xuanze].ui;
            hand[ccc][xuanze].num--;
            if(hand[ccc][xuanze].num==0){
                hand[ccc][xuanze].ui=0;
            }
        }
        if(a[ccc][jjj][xxx][yyy]==20) furnace(ccc);
        return ;
    }
    dq='2';
}
void LoginXZ(){
    char c;
    Log:
    system("cls");
    color(14);
    Line("登录XZ账号 --- Login XZ");
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    color(7);
    Line("L-登录     M-退出");
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    color(10); 
    Line("没有账号? R-注册");
    color(7);
    c=getch();
    system("cls");
    if(c=='L' || c=='l'){
        ifstream fin("XZ账户.xzdata");
        fin>>nam>>pas;
        fin.close();
        color(14);
        Line("输入密码");
        color(12);
        Line("用户名:"+nam);
        color(7);
        string pass1;
        int i=0;
        char ch;
        while ((ch=_getch())!=13)
        {
            pass1+=ch;
            cout<<"*";
        }
        if(pass1!=pas){
            system("cls");
            Line("抱歉!输入密码错误!请重新登录!(三秒钟后返回)");
            goto Log;
        }
        return ;
    }
    else if(c=='R' || c=='r'){
        color(14);
        Line("注册XZ账号 --- Register XZ");
        cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        color(7);
        Line("G-注册一个XZ账号   H-读取王子逸的行走账号");
        cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        color(10); 
        Line("已有账号? M-登录");
        color(7);
        c=getch();
        if(c=='M' || c=='m'){
            goto Log;
        }
        else if(c=='H' || c=='h'){
            system("cls");
            color(14);
            Line("读取XZ账号 --- Read XZ");
            color(7);
            Line("使用提示:请将行走建立的“存档.txt”文件复制到您保存的文件根目录下"); 
            cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
            Line("G-读取存档");
            cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
            color(10); 
            Line("已有账号? M-登录");
            color(7);
            c=getch();
            if(c=='M' || c=='m'){
                goto Log;
            }else if(c=='G' || c=='g'){
                ifstream fin("存档.txt");
                int lllll;
                fin>>lllll;
                fin>>lllll;
                fin>>nam;
                fin>>lllll;
                fin>>nam;
                fin.close();
                string s1,s2;
                system("cls");
                color(14);
                Line("设置密码");
                color(7);
                cin>>s1;
                system("cls");
                color(14);
                Line("再输入一次密码");
                color(7);
                cin>>s2;
                if(s1!=s2){
                    system("cls");
                    Line("抱歉!输入密码错误!请重新注册!(三秒钟后返回)");
                    goto Log;
                }
                pas=s1;
                return ;
            }else goto Log;
        } 
        else if(c=='G' || c=='g'){
            system("cls");
            color(14);
            Line("设置用户名");
            color(7);
            cin>>nam;
            string s1,s2;
            system("cls");
            color(14);
            Line("设置密码");
            color(7);
            cin>>s1;
            system("cls");
            color(14);
            Line("再输入一次密码");
            color(7);
            cin>>s2;
            if(s1!=s2){
                system("cls");
                Line("抱歉!输入密码错误!请重新注册!(三秒钟后返回)");
                goto Log;
            }
            pas=s1;
            return ;
        }
        else goto Log;
    }else if(c=='M' || c=='m'){
        goto Logok;
    }
    else goto Log;
    Logok:;
}
void XZLogin(){
    color(7);
    LoginXZ();
    ofstream fout("XZ账户.xzdata");
    fout<<nam<<endl<<pas;
    fout.close();
    return ;
}
void buybf(){
    int xuanz=0;
    while(cmmd!='M' && cmmd!='m'){
        system("cls");
        color(12);
        Line("购买皮肤");
        color(7);
        cout<<"                  您有金币:"<<jb<<"个"<<endl;
        for(int i=0;i<pfn;i++){
            cout<<"                  ";
            if(bpf[i]){
                color(10);
                cout<<"已拥有";
            }else{
                color(12);
                cout<<"未拥有";
            }
            color(7);
            if(xuanz==i) cout<<"    > ";
            else cout<<"      ";
            cout<<pfs[i]<<" : "<<pfp[i];
            cout<<endl;
        }
        Line("W/S-切换   E-选择   M-退出");
        cmmd=getch();
        if(cmmd=='W' || cmmd=='w') xuanz--;
        if(cmmd=='S' || cmmd=='s') xuanz++;
        if(cmmd=='E' || cmmd=='e'){
            if(bpf[xuanz]==1) pfd=pfs[xuanz];
            else if(jb>=pfp[xuanz]){
                jb=jb-pfp[xuanz];
                bpf[xuanz]=1;
                pfd=pfs[xuanz];
            }
        }
        if(xuanz>=pfn) xuanz=0;
    }
}
void buycor(){
    int xuanz=0;
    while(cmmd!='M' && cmmd!='m'){
        system("cls");
        color(12);
        Line("切换颜色");
        color(7);
        for(int i=max(0,xuanz-10);i<=min(255,xuanz+10);i++){
            cout<<"                                 ";
            color(7);
            if(xuanz==i) cout<<"    > ";
            else cout<<"      ";
            ppf(i);
            cout<<endl;
        }
        color(7); 
        Line("W/S-切换   E-选择   M-退出");
        cmmd=getch();
        if(cmmd=='W' || cmmd=='w') xuanz--;
        if(cmmd=='S' || cmmd=='s') xuanz++;
        if(cmmd=='E' || cmmd=='e'){
            sehao=xuanz;
        }
        if(xuanz>=256) xuanz=0;
    }
}
void shang(){//本市最繁华的商城 
    system("cls");
    color(7);
    system("cls");
    chuancan=0;
    int xxx=10,yyy=10;
    while(!(xxx==16 && yyy==16)){
        system("cls");
        for(i=0;i<21;i++){
            cout<<"                   ";
            color(7);
            for(j=0;j<21;j++){
                if(i==xxx && j==yyy){
                    ppf(sehao);
                }else print(shop[i][j]);
            }
            color(7);
            cout<<endl;
        }
        cout<<"   您有金币:"<<jb<<"个"<<"     "<<"WASD-移动  站在图例格子上即可触发功能";
        cout<<endl<<"                 ";
        print(6);
        color(7);
        cout<<" - 切换皮肤";
        cout<<"                     ";
        print(15);
        color(7);
        cout<<" - 切换颜色";
        cout<<endl<<"                 ";
        print(28);
        color(7);
        cout<<" - 客服服务(需要洛谷账号)";
        cout<<"       ";
        print(14);
        color(7);
        cout<<" - 退出商城";
        cmmd=getch();
        if(cmmd=='W' || cmmd=='w') xxx--;
        if(cmmd=='A' || cmmd=='a') yyy--;
        if(cmmd=='S' || cmmd=='s') xxx++;
        if(cmmd=='D' || cmmd=='d') yyy++;
        if(xxx<=0) xxx=1;
        if(xxx>=20) xxx=19;
        if(yyy<=0) yyy=1;
        if(yyy>=20) yyy=19;
        if(xxx==4 && yyy==4){
            buybf();
            xxx=10;
            yyy=10;
        }
        if(xxx==4 && yyy==16){
            buycor();
            xxx=10;
            yyy=10;
        }
        if(xxx==16 && yyy==4){
            xxx=10;
            yyy=10;
            system("start https://www.luogu.com.cn/chat?uid=541826");
        }
    }
}
bool checks(string s1,string s2){
    int num=0;
    for(int p=0;p<s2.size();p++){
        if(s1[p]!=s2[p]) num++;
    }
    if(num<=1 && s2.size()>1) return 1;
    return 0;
}
void Exchange_code(){
    system("cls");
    color(240);
    system("cls");
    Line("兑换码");
    cout<<endl<<endl<<endl<<endl<<endl;
    Line("请输入你的兑换码");
    cout<<endl<<"           ";
    cin>>comd;
    int tot=0;
    for(i=1;i<=eclisn;i++){
        if(checks(eclis[i].ecs,XAPin(comd))){
            tot=i;
            if(echave[i]==1) tot=-2;
            echave[i]=1;
            break;
        }else if(checks(eclis[i].ecs,comd)){
            tot=-1;
            break;
        }
    }
    system("cls");
    color(240);
    system("cls");
    if(tot>0){
        Line("兑换成功");
        cout<<endl<<endl<<endl<<endl<<endl<<endl;
        Line("您兑换到的是"+eclis[tot].nam);
        cout<<endl;
        Line("您获得了"+change_string(eclis[tot].jb)+"金币");
        cout<<endl;
        if(eclis[tot].emc!=0){
            Line("您获得了"+change_string(eclis[tot].emc)+"经验");
            cout<<endl;
        }
        color(252);
        Line(eclis[tot].notice);
        cout<<endl;
        color(240);
        jb+=eclis[tot].jb;
        emc+=eclis[tot].emc;
    }else if(tot==-1){
        Line("兑换失败");
        cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        color(252);
        Line("    XACRAFT检测到您尝试查看代码以获取兑换码,希望您在日常的游戏生活中能够规范自己的游戏行为,诚信游戏!");
        cout<<endl<<endl<<endl;
        color(240);
    }else if(tot==-2){
        Line("兑换失败");
        cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        color(252);
        Line("该兑换码已被兑换过");
        cout<<endl<<endl<<endl;
        color(240);
    }else{
        Line("兑换失败");
        cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        color(252);
        Line("未查找到兑换码");
        cout<<endl<<endl<<endl;
        color(240);
    }
    Line("[按任意键退出]");
    cmmd=getch();
    cmmd='?';
    return ;
}
void mycenter(){
    while(!(cmmd=='e' || cmmd=='E')){
        system("cls");
        color(240);
        system("cls");
        Line("个人中心");
        cout<<endl<<endl<<endl<<endl;
        color(240);
        if(tecnam.empty()) Line("TEC账号:未登录");
        else Line("TEC账号:已登录("+tecnam+")");
        cout<<endl;
        Line("经验值:"+change_string(emc));
        Line("等级:Lv."+change_string((emc/50)+1));
        cout<<endl;
        Line("G-中心商城");
        cout<<endl;
        Line("H-兑 换 码");
        cout<<endl;
        Line("E-退出个人中心");
        cmmd=getch();
        if(cmmd=='G' || cmmd=='g') shang();
        if(cmmd=='H' || cmmd=='h') Exchange_code();
    }
    cmmd='?';
}
void printt(int com){
    int wq=10;
    cout<<"                  "; 
    color(12);
    for(i=1;i<=10;i++){
        if(smz[com]>=i*10) cout<<"█",wq--;
    }
    if(smz[com]%10==1) cout<<"▏",wq--;
    else if(smz[com]%10==2) cout<<"▎",wq--;
    else if(smz[com]%10==3) cout<<"▍",wq--;
    else if(smz[com]%10==4 || smz[com]%10==5 || smz[com]%10==6) cout<<"▌",wq--;
    else if(smz[com]%10==7) cout<<"▋",wq--;
    else if(smz[com]%10==8) cout<<"▊",wq--;
    else if(smz[com]%10==9) cout<<"▉",wq--;
    for(i=1;i<=wq;i++) cout<<"  "; 
    cout<<"    "; 
    color(6);
    for(i=1;i<=10;i++){
        if(jed[com]>=i*10) cout<<"█";
    }
    if(jed[com]%10==1) cout<<"▏";
    else if(jed[com]%10==2) cout<<"▎";
    else if(jed[com]%10==3) cout<<"▍";
    else if(jed[com]%10==4 || jed[com]%10==5 || jed[com]%10==6) cout<<"▌";
    else if(jed[com]%10==7) cout<<"▋";
    else if(jed[com]%10==8) cout<<"▊";
    else if(jed[com]%10==9) cout<<"▉";
    cout<<"                ";
}
int nw(int com){
    smz[com]=100;
    jed[com]=100;
    jiandang[com]=true; 
    //1 定型 
    for(i=0;i<=2047;i++){
        for(j=1;j<=255;j++){
            a[com][1][j][i]=0;
        }
    }
    for(i=1;i<=50;i++){
        hand[com][i].ui=0;
        hand[com][i].num=0;
    } 
    int ke=0;
    system("cls");
    color(252);
    system("cls");
    Line("我的存档");
    color(240);
    Line("新的世界"); 
    cout<<endl<<endl;
    line("选择模式(1:生存模式  2:创造模式): ");
    cin>>mode[com];
    cout<<endl;
    line("输入种子: ");
    cin>>comd;
    seed=change_num(comd);
    comd="?";
    srand((unsigned)seed);
    y[com]=1024;
    int top=0,tot=rdm(40,60); 
    for(i=0;i<2048;i++){
        if(i==1024){
            x[com]=tot; 
            do{
                ++x[com];
            }while(a[com][1][x[com]][top]!=0);
            x[com]+=3;
            cx[com]=x[com];
            cy[com]=y[com];
        }
                a[com][1][tot+1][top]=3;
                a[com][1][tot+1][top-3]=3;
                a[com][1][tot+1][top-2]=3;
                a[com][1][tot+1][top-1]=3;
                a[com][1][tot+1][top+1]=3;
                a[com][1][tot+1][top+2]=3;
                a[com][1][tot+1][top+3]=3;
                a[com][1][tot+2][top-3]=3;
                a[com][1][tot+2][top-2]=3;
                a[com][1][tot+2][top]=3;
                a[com][1][tot+2][top-1]=3;
                a[com][1][tot+2][top+1]=3;
                a[com][1][tot+2][top+2]=3;
                a[com][1][tot+2][top+3]=3;
                a[com][1][tot+3][top-2]=3;
                a[com][1][tot+3][top]=3;
                a[com][1][tot+3][top-1]=3;
                a[com][1][tot+3][top+1]=3;
                a[com][1][tot+3][top+2]=3;
                a[com][1][tot+4][top]=3;
                a[com][1][tot+4][top-1]=3;
                a[com][1][tot+4][top+1]=3;
        for(j=tot;j>=0;j--){
            a[com][1][j][top]=3;
        }
        top++;
        int u=rdm(0,10);
        if(u>=9) tot++;
        if(u<=1) tot--;
        if(tot>=256)tot=255;
        if(tot<10) tot=10;
        int uu=rdm(0,8);
    /*  if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && ke+1<top && seed!=1234567890)||(seed==123456789)){
            ke=top;
            a[com][1][tot+1][top]=6;
            a[com][1][tot+2][top]=6;
            a[com][1][tot+3][top]=6;
            int uuu=rdm(0,3);
            if(uuu==1){
                a[com][1][tot+4][top]=6;
                a[com][1][tot+4][top-3]=2;
                a[com][1][tot+4][top-2]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+4][top+2]=2;
                a[com][1][tot+4][top+3]=2;
                a[com][1][tot+5][top-3]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+5][top+3]=2;
                a[com][1][tot+6][top-2]=2;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
                a[com][1][tot+6][top+2]=2;
                a[com][1][tot+7][top]=2;
                a[com][1][tot+7][top-1]=2;
                a[com][1][tot+7][top+1]=2;
            }else{
                a[com][1][tot+3][top-3]=2;
                a[com][1][tot+3][top-2]=2;
                a[com][1][tot+3][top-1]=2;
                a[com][1][tot+3][top+1]=2;
                a[com][1][tot+3][top+2]=2;
                a[com][1][tot+3][top+3]=2;
                a[com][1][tot+4][top-3]=2;
                a[com][1][tot+4][top-2]=2;
                a[com][1][tot+4][top]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+4][top+2]=2;
                a[com][1][tot+4][top+3]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
            }
        }*/
    }
    //2  定系
    int u=rdm(1,100),pl=0;
    for(i=1;i<=2048;i++){
        int tot;
        for(j=256;j>=0;j--){
            if(a[com][1][j][i]==3){
                tot=j;
                break;
            }
        }
        if(u<=30){
            a[com][1][tot][i]=1;
            a[com][1][tot-1][i]=4;
            a[com][1][tot-2][i]=4;
            a[com][1][tot-3][i]=4;
            int uu=rdm(0,8);
            if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
                top=i;
                pl=i+1;
            a[com][1][tot+1][top]=6;
            a[com][1][tot+2][top]=6;
            a[com][1][tot+3][top]=6;
            int uuu=rdm(0,3);
            if(uuu==1){
                a[com][1][tot+4][top]=6;
                a[com][1][tot+4][top-3]=2;
                a[com][1][tot+4][top-2]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+4][top+2]=2;
                a[com][1][tot+4][top+3]=2;
                a[com][1][tot+5][top-3]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+5][top+3]=2;
                a[com][1][tot+6][top-2]=2;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
                a[com][1][tot+6][top+2]=2;
                a[com][1][tot+7][top]=2;
                a[com][1][tot+7][top-1]=2;
                a[com][1][tot+7][top+1]=2;
            }else{
                a[com][1][tot+3][top-3]=2;
                a[com][1][tot+3][top-2]=2;
                a[com][1][tot+3][top-1]=2;
                a[com][1][tot+3][top+1]=2;
                a[com][1][tot+3][top+2]=2;
                a[com][1][tot+3][top+3]=2;
                a[com][1][tot+4][top-3]=2;
                a[com][1][tot+4][top-2]=2;
                a[com][1][tot+4][top]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+4][top+2]=2;
                a[com][1][tot+4][top+3]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
            }
        }
        }
        else if(u<=50){
            a[com][1][tot][i]=11;
            a[com][1][tot-1][i]=11;
            a[com][1][tot-2][i]=11;
            a[com][1][tot-3][i]=12;
            int uu=rdm(0,8);
            if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
                top=i;
                pl=i+1;
                int uuu=rdm(0,3);
                if(uuu==1){
                    a[com][1][tot+1][top]=14;
                    a[com][1][tot+2][top]=14;
                    a[com][1][tot+3][top]=14;
                    a[com][1][tot+4][top]=14;
                }else{
                    a[com][1][tot+1][top]=14;
                    a[com][1][tot+2][top]=14;
                    a[com][1][tot+3][top]=14;
                }
            }
        }else if(u<=80){
            a[com][1][tot][i]=1;
            a[com][1][tot-1][i]=4;
            a[com][1][tot-2][i]=4;
            a[com][1][tot-3][i]=4;
            int uu=rdm(0,8);
            if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
                top=i;
                pl=i+1;
            a[com][1][tot+1][top]=15;
            a[com][1][tot+2][top]=15;
            a[com][1][tot+3][top]=15;
            int uuu=rdm(0,3);
            if(uuu==1){
                a[com][1][tot+4][top]=15;
                a[com][1][tot+4][top-3]=2;
                a[com][1][tot+4][top-2]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+4][top+2]=2;
                a[com][1][tot+4][top+3]=2;
                a[com][1][tot+5][top-3]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+5][top+3]=2;
                a[com][1][tot+6][top-2]=2;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
                a[com][1][tot+6][top+2]=2;
                a[com][1][tot+7][top]=2;
                a[com][1][tot+7][top-1]=2;
                a[com][1][tot+7][top+1]=2;
            }else{
                a[com][1][tot+3][top-3]=2;
                a[com][1][tot+3][top-2]=2;
                a[com][1][tot+3][top-1]=2;
                a[com][1][tot+3][top+1]=2;
                a[com][1][tot+3][top+2]=2;
                a[com][1][tot+3][top+3]=2;
                a[com][1][tot+4][top-3]=2;
                a[com][1][tot+4][top-2]=2;
                a[com][1][tot+4][top]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+4][top+2]=2;
                a[com][1][tot+4][top+3]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
            }
        }
        }else{
            a[com][1][tot][i]=13;
            a[com][1][tot-1][i]=4;
            a[com][1][tot-2][i]=4;
            a[com][1][tot-3][i]=4;
            int uu=rdm(0,15);
            if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
                top=i;
                pl=i+1;
            a[com][1][tot+1][top]=28;
            a[com][1][tot+2][top]=28;
            a[com][1][tot+3][top]=28;
            int uuu=rdm(0,3);
            if(uuu==1){
                a[com][1][tot+4][top]=28;
                a[com][1][tot+5][top]=28;
                a[com][1][tot+6][top]=28;
                a[com][1][tot+7][top]=28;
                a[com][1][tot+3][top-3]=2;
                a[com][1][tot+3][top-2]=2;
                a[com][1][tot+3][top-1]=2;
                a[com][1][tot+3][top+3]=2;
                a[com][1][tot+3][top+2]=2;
                a[com][1][tot+3][top+1]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
                a[com][1][tot+8][top]=28;
                a[com][1][tot+8][top-1]=2;
                a[com][1][tot+8][top+1]=2;
                a[com][1][tot+9][top]=2;
            }else{
                a[com][1][tot+4][top]=28;
                a[com][1][tot+5][top]=28;
                a[com][1][tot+6][top]=2;
                a[com][1][tot+3][top-3]=2;
                a[com][1][tot+3][top-2]=2;
                a[com][1][tot+3][top-1]=2;
                a[com][1][tot+3][top+3]=2;
                a[com][1][tot+3][top+2]=2;
                a[com][1][tot+3][top+1]=2;
                a[com][1][tot+4][top-1]=2;
                a[com][1][tot+4][top+1]=2;
                a[com][1][tot+5][top-2]=2;
                a[com][1][tot+5][top-1]=2;
                a[com][1][tot+5][top+2]=2;
                a[com][1][tot+5][top+1]=2;
                a[com][1][tot+6][top-1]=2;
                a[com][1][tot+6][top+1]=2;
                a[com][1][tot+7][top]=2;
            }
            }
        }
        if(i%128==0 && i!=1024) u=rdm(1,100);
    } 
    //
    for(i=1;i<=2048;i++){
        for(j=1;j<=16;j++){
            if(a[com][1][j][i]==3){
                int uuu=rdm(1,1000);
                if(uuu<=1){
                    a[com][1][j][i]=7;
                }
            }
        }
        for(j=4;j<=32;j++){
            if(a[com][1][j][i]==3){
                int uuu=rdm(1,1000);
                if(uuu<=5){
                    a[com][1][j][i]=8;
                }
            }
        }
        for(j=1;j<=64;j++){
            if(a[com][1][j][i]==3){
                int uuu=rdm(1,1000);
                if(uuu<=8){
                    a[com][1][j][i]=21;
                }
            }
        }
        for(j=1;j<=256;j++){
            if(a[com][1][j][i]==2){
                int uuu=rdm(1,1000);
                if(uuu<=5){
                    int uuuu=rdm(1,1000);
                    if(uuuu>200) a[com][1][j][i]=9;
                    else a[com][1][j][i]=10;
                }
            }
        }
    } 
}
int died(){
    system("cls");
    color(79);
    system("cls");
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    Line("你失败了!");
    cout<<endl<<endl;
    Line("G - **     P - 退出");
    while(true){
        if(kd('G')){
            system("cls");
            color(7);
            system("cls");
            return 1;
        }
        if(kd('P')){
            system("cls");
            color(7);
            system("cls");
            return 2;
        }   
    }   
}
void survival(int com){
    cls();
    int ztl=2,highlowdown=0,dek=0;
    while(!(kd('P') || dek==2)){
        cls();
        tims[com]+=1;
        if(tims[com]>=10000){
            days[com]++;
            tims[com]=0;
        }
        if(tims[com]<=5500) chuancan=240;
        else if(tims[com]<=6000) chuancan=224;
        else if(tims[com]<=9500) chuancan=0;
        else chuancan=224;
        if(tims[com]%100==0){
            jb+=(tims[com]+days[com]*10000)/1000;
            emc+=1; 
        }
        for(i=x[com]+10;i>=x[com]-10;i--){
            for(j=y[com]-19;j<=y[com]+19;j++){
                if(i==-1 || j<0 || j>2048){
                    color(15);
                    printf("▓");
                }
                /*else if(a[com][1][i-1][j]!=0 && a[com][1][i+1][j]!=0 && a[com][1][i][j+1]!=0 && a[com][1][i][j-1]!=0){
                    color(7);
                    cout<<"  ";
                }*/else if(i!=x[com] || j!=y[com]){
                    print(a[com][1][i][j]);
                }else{
                    ppf(sehao);
                }
            }
            cout<<endl;
        }
        if(x[com]<=1){
            x[com]=1;
        }
        if(x[com]>256){
            x[com]=256;
        }
        if(y[com]<0){
            y[com]=0;
        }
        if(y[com]>2048){
            y[com]=2048;
        }
        color(15);
        if(ztl==1){
            printf(">>状态栏 坐标: x:%d y:%d ",x[com],y[com]);
            cout<<"后位方块:";
            print(a[com][1][x[com]][y[com]]);
            color(15);
            cout<<" 当前:";
            if(kn){
                color(12);
                cout<<"**"; 
            }else{
                color(10);
                cout<<"建造";
            } 
            color(15);
            cout<<"模式(J切换) P-保存并退出 ";
        }else if(ztl==2){
            printt(com);
        }
        cout<<endl;
        color(7);
        Line("                               "+wri(hand[com][xuanze].ui)+"                               ");
        color(7);
        cout<<"\t\t\t       ";
        for(i=1;i<=9;i++){
            color(7);
            if(hand[com][i].num!=0){
                print(hand[com][i].ui);
            }else{
                cout<<"□";
            }
        }
        color(7);
        cout<<"                             ";
        cout<<endl<<"\t\t\t       ";
        for(i=1;i<=9;i++){
            if(i==xuanze) color(11);
            else color(7);
            if(hand[com][i].num!=0){
                if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
                else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
                else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
                else cout<<hand[com][i].num%10000/1000<<"^";
            }else{
                cout<<"--";
            }
        }
        cout<<"                             ";
        //Sleep(100);
        if(cmmd=='/'){
            cls();
            color(12);
            Line("命令");
            bool flag=0;
            while(comd!="esc"){ 
                color(7);
                cout<<"/";
                cin>>comd;
                if(comd=="tp"){
                    cout<<"/tp @s ";
                    cin>>i>>j;
                    flag=1;
                    x[com]=i;
                    y[com]=j;
                    comd="esc";
                }
                if(!flag){
                    color(12);
                    cout<<">>语法错误"<<endl;
                    color(7);
                }
            }
            comd="?";
        }
        //掉血、饥饿机制 始 
        if(a[com][1][x[com]][y[com]]!=0 && tims[com]%10==0){
            smz[com]-=8;
        }
        if(kd('Z') && tims[com]%2==0){
            if(hand[com][xuanze].ui==9){
                jed[com]+=20;
                del(com,9,1);
            }
            if(hand[com][xuanze].ui==10){
                smz[com]+=10;
                jed[com]+=40;
                del(com,10,1);
            }
        }
        if(tims[com]%50==0 && jed[com]>=30){
            smz[com]++;
        }
        if(tims[com]%100==0){
            jed[com]-=2;
        }
        if(smz[com]>=100) smz[com]=100;
        if(jed[com]>=100) jed[com]=100;
        if(a[com][1][x[com]-1][y[com]]==0) highlowdown++;
        else{
            if(highlowdown>=5) smz[com]-=(highlowdown-4)*3;
            highlowdown=0;
        }
        if(a[com][1][x[com]-1][y[com]]==14 || a[com][1][x[com]+1][y[com]]==14 || a[com][1][x[com]][y[com]-1]==14 || a[com][1][x[com]][y[com]+1]==14){
            if(tims[com]%10==0) smz[com]-=5;
        }
        if(smz[com]<=0){
            jed[com]=smz[com]=100;
            x[com]=cx[com];
            y[com]=cy[com];
            dek=died();
        }
        if(jed[com]<=0){
            jed[com]=0;
            if(tims[com]%25==0) smz[com]-=2;
        }
        //掉血、饥饿机制 终 
        if(kd('L')){
            if(ztl==1) ztl=2;
            else ztl=1;
            Sleep(200);
        }
        if(kd('E')){
            while(kd('E')){ 
            }
            packback(com);
            Sleep(100);
        }
        if(kd('W')&& a[com][1][x[com]-1][y[com]]!=0){
            if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]==0)){
                x[com]+=4;
            }
            else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]!=0)){
                x[com]+=3;
            }
            else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]!=0)){
                x[com]+=2;
            }
        }
        //if(cmmd=='S' || cmmd=='s') x[com]--;
        if(a[com][1][x[com]-1][y[com]]==0){
            Sleep(20);
            x[com]--;
        }
        if(kd('A')){
            if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]==0){
                x[com]--;
                y[com]--;
            }
            else if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]!=0){
                y[com]--;
            }
            else if(a[com][1][x[com]][y[com]-1]!=0 && a[com][1][x[com]+1][y[com]-1]==0 && a[com][1][x[com]+1][y[com]]==0){
                x[com]++;
                y[com]--;
            }
        } //y[com]--;
        if(kd('D')){
            if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]==0){
                x[com]--;
                y[com]++;
            }
            else if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]!=0){
                y[com]++;
            }
            else if(a[com][1][x[com]][y[com]+1]!=0 && a[com][1][x[com]+1][y[com]+1]==0 && a[com][1][x[com]+1][y[com]]==0){
                x[com]++;
                y[com]++;
            }
        } //y[com]++;
        if(kd('J')){
            kn=!kn;
            while(kd('J')){
            }
        } 
        if(kd('1')) xuanze=1;
        if(kd('2')) xuanze=2;
        if(kd('3')) xuanze=3;
        if(kd('4')) xuanze=4;
        if(kd('5')) xuanze=5;
        if(kd('6')) xuanze=6;
        if(kd('7')) xuanze=7;
        if(kd('8')) xuanze=8;
        if(kd('9')) xuanze=9;
        if(kd('Q') && a[com][1][x[com]+1][y[com]]==0 && /*a[com][1][x[com]-1][y[com]]!=0 &&*/ hand[com][xuanze].num!=0){
            x[com]++;
            pt(com,1,x[com]-1,y[com],true);
        }
        if(kn){
            if(kd('Y')){
                //hand[com][a[com][1][x[com]+1][y[com]-1]]++;
                //a[com][1][x[com]+1][y[com]-1]=0;
                pt(com,1,x[com]+1,y[com]-1,false);
            }
            if(kd('U')){
                //hand[com][a[com][1][x[com]+1][y[com]]]++;
                //a[com][1][x[com]+1][y[com]]=0;
                pt(com,1,x[com]+1,y[com],false);
            } 
            if(kd('I')){
                //hand[com][a[com][1][x[com]+1][y[com]+1]]++;
                //a[com][1][x[com]+1][y[com]+1]=0;
                pt(com,1,x[com]+1,y[com]+1,false);
            }
            if(kd('H')){
                //hand[com][a[com][1][x[com]][y[com]-1]]++;
                //a[com][1][x[com]][y[com]-1]=0;
                pt(com,1,x[com],y[com]-1,false);
            }
            if(kd('K')){
                //hand[com][a[com][1][x[com]][y[com]+1]]++;
                //a[com][1][x[com]][y[com]+1]=0;
                pt(com,1,x[com],y[com]+1,false);
            }
            if(kd('B')){
                //hand[com][a[com][1][x[com]-1][y[com]-1]]++;
                //a[com][1][x[com]-1][y[com]-1]=0;
                pt(com,1,x[com]-1,y[com]-1,false);
            }
            if(kd('N')){
                //hand[com][a[com][1][x[com]-1][y[com]]]++;
                //a[com][1][x[com]-1][y[com]]=0;
                pt(com,1,x[com]-1,y[com],false);
            }
            if(kd('M')){
                //hand[com][a[com][1][x[com]-1][y[com]+1]]++;
                //a[com][1][x[com]-1][y[com]+1]=0;
                pt(com,1,x[com]-1,y[com]+1,false);
            }
        }
        if(!kn){
            if(kd('Y')){
                //hand[com][a[com][1][x[com]+1][y[com]-1]]++;
                //a[com][1][x[com]+1][y[com]-1]=0;
                pt(com,1,x[com]+1,y[com]-1,true);
            }
            if(kd('U')){
                //hand[com][a[com][1][x[com]+1][y[com]]]++;
                //a[com][1][x[com]+1][y[com]]=0;
                pt(com,1,x[com]+1,y[com],true);
            } 
            if(kd('I')){
                //hand[com][a[com][1][x[com]+1][y[com]+1]]++;
                //a[com][1][x[com]+1][y[com]+1]=0;
                pt(com,1,x[com]+1,y[com]+1,true);
            }
            if(kd('H')){
                //hand[com][a[com][1][x[com]][y[com]-1]]++;
                //a[com][1][x[com]][y[com]-1]=0;
                pt(com,1,x[com],y[com]-1,true);
            }
            if(kd('K')){
                //hand[com][a[com][1][x[com]][y[com]+1]]++;
                //a[com][1][x[com]][y[com]+1]=0;
                pt(com,1,x[com],y[com]+1,true);
            }
            if(kd('B')){
                //hand[com][a[com][1][x[com]-1][y[com]-1]]++;
                //a[com][1][x[com]-1][y[com]-1]=0;
                pt(com,1,x[com]-1,y[com]-1,true);
            }
            if(kd('N')){
                //hand[com][a[com][1][x[com]-1][y[com]]]++;
                //a[com][1][x[com]-1][y[com]]=0;
                pt(com,1,x[com]-1,y[com],true);
            }
            if(kd('M')){
                //hand[com][a[com][1][x[com]-1][y[com]+1]]++;
                //a[com][1][x[com]-1][y[com]+1]=0;
                pt(com,1,x[com]-1,y[com]+1,true);
            }
        }
        color(7);
    }
    while(kd('P')){
    }
    cmmd='?';
    while(cmmd!='P' && cmmd!='p'){
        cmmd=getch();
    }
    cmmd='?';
}
void create(int com){
    cls();
    while(!kd('P')){
        cls();
        tims[com]+=1;
        if(tims[com]>=10000){
            days[com]++;
            tims[com]=0;
        }
        if(tims[com]<=5500) chuancan=240;
        else if(tims[com]<=6000) chuancan=224;
        else if(tims[com]<=9500) chuancan=0;
        else chuancan=224;
        if(tims[com]%100==0){
            jb+=(tims[com]+days[com]*10000)/1000;
            emc+=1;
        }
        for(i=x[com]+10;i>=x[com]-10;i--){
            for(j=y[com]-19;j<=y[com]+19;j++){
                if(i==-1 || j<0 || j>2048){
                    color(15);
                    printf("▓");
                }
                /*else if(a[com][1][i-1][j]!=0 && a[com][1][i+1][j]!=0 && a[com][1][i][j+1]!=0 && a[com][1][i][j-1]!=0){
                    color(7);
                    cout<<"  ";
                }*/else if(i!=x[com] || j!=y[com]){
                    print(a[com][1][i][j]);
                }else{
                    ppf(sehao);
                }
            }
            cout<<endl;
        }
        if(x[com]<=1){
            x[com]=1;
        }
        if(x[com]>256){
            x[com]=256;
        }
        if(y[com]<0){
            y[com]=0;
        }
        if(y[com]>2048){
            y[com]=2048;
        }
        color(15);
        printf(">>状态栏 坐标: x:%d y:%d ",x[com],y[com]);
        cout<<"后位方块:";
        print(a[com][1][x[com]][y[com]]);
        color(15);
        cout<<" 当前:";
        if(kn){
            color(12);
            cout<<"**"; 
        }else{
            color(10);
            cout<<"建造";
        } 
        color(15);
        cout<<"模式(J切换) P-保存并退出 ";
        cout<<endl;
        color(7);
        Line("                               "+wri(hand[com][xuanze].ui)+"                               ");
        color(7);
        cout<<"\t\t\t       ";
        for(i=1;i<=9;i++){
            color(7);
            if(hand[com][i].num!=0){
                print(hand[com][i].ui);
            }else{
                cout<<"□";
            }
        }
        color(7);
        cout<<"                             ";
        cout<<endl<<"\t\t\t       ";
        for(i=1;i<=9;i++){
            if(i==xuanze) color(11);
            else color(7);
            if(hand[com][i].num!=0){
                if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
                else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
                else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
                else cout<<hand[com][i].num%10000/1000<<"^";
            }else{
                cout<<"--";
            }
        }
        cout<<"                             ";
        //Sleep(100);
        if(cmmd=='/'){
            cls();
            color(12);
            Line("命令");
            bool flag=0;
            while(comd!="esc"){ 
                color(7);
                cout<<"/";
                cin>>comd;
                if(comd=="tp"){
                    cout<<"/tp @s ";
                    cin>>i>>j;
                    flag=1;
                    x[com]=i;
                    y[com]=j;
                    comd="esc";
                }
                if(!flag){
                    color(12);
                    cout<<">>语法错误"<<endl;
                    color(7);
                }
            }
            comd="?";
        }
        if(kd('E')){
            while(kd('E')){ 
            }
            packback(com);
            Sleep(100);
        }
        if(kd('W')&& a[com][1][x[com]-1][y[com]]!=0){
            if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]==0)){
                x[com]+=4;
            }
            else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]!=0)){
                x[com]+=3;
            }
            else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]!=0)){
                x[com]+=2;
            }
        }
        //if(cmmd=='S' || cmmd=='s') x[com]--;
        if(a[com][1][x[com]-1][y[com]]==0){
            Sleep(20);
            x[com]--;
        }
        if(kd('A')){
            if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]==0){
                x[com]--;
                y[com]--;
            }
            else if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]!=0){
                y[com]--;
            }
            else if(a[com][1][x[com]][y[com]-1]!=0 && a[com][1][x[com]+1][y[com]-1]==0 && a[com][1][x[com]+1][y[com]]==0){
                x[com]++;
                y[com]--;
            }
        } //y[com]--;
        if(kd('D')){
            if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]==0){
                x[com]--;
                y[com]++;
            }
            else if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]!=0){
                y[com]++;
            }
            else if(a[com][1][x[com]][y[com]+1]!=0 && a[com][1][x[com]+1][y[com]+1]==0 && a[com][1][x[com]+1][y[com]]==0){
                x[com]++;
                y[com]++;
            }
        } //y[com]++;
        if(kd('J')){
            kn=!kn;
            while(kd('J')){
            }
        } 
        if(kd('1')) xuanze=1;
        if(kd('2')) xuanze=2;
        if(kd('3')) xuanze=3;
        if(kd('4')) xuanze=4;
        if(kd('5')) xuanze=5;
        if(kd('6')) xuanze=6;
        if(kd('7')) xuanze=7;
        if(kd('8')) xuanze=8;
        if(kd('9')) xuanze=9;
        if(kd('Q') && a[com][1][x[com]+1][y[com]]==0 && /*a[com][1][x[com]-1][y[com]]!=0 &&*/ hand[com][xuanze].num!=0){
            x[com]++;
            pt(com,1,x[com]-1,y[com],true);
        }
        if(kn){
            if(kd('Y')){
                //hand[com][a[com][1][x[com]+1][y[com]-1]]++;
                //a[com][1][x[com]+1][y[com]-1]=0;
                pt(com,1,x[com]+1,y[com]-1,false);
            }
            if(kd('U')){
                //hand[com][a[com][1][x[com]+1][y[com]]]++;
                //a[com][1][x[com]+1][y[com]]=0;
                pt(com,1,x[com]+1,y[com],false);
            } 
            if(kd('I')){
                //hand[com][a[com][1][x[com]+1][y[com]+1]]++;
                //a[com][1][x[com]+1][y[com]+1]=0;
                pt(com,1,x[com]+1,y[com]+1,false);
            }
            if(kd('H')){
                //hand[com][a[com][1][x[com]][y[com]-1]]++;
                //a[com][1][x[com]][y[com]-1]=0;
                pt(com,1,x[com],y[com]-1,false);
            }
            if(kd('K')){
                //hand[com][a[com][1][x[com]][y[com]+1]]++;
                //a[com][1][x[com]][y[com]+1]=0;
                pt(com,1,x[com],y[com]+1,false);
            }
            if(kd('B')){
                //hand[com][a[com][1][x[com]-1][y[com]-1]]++;
                //a[com][1][x[com]-1][y[com]-1]=0;
                pt(com,1,x[com]-1,y[com]-1,false);
            }
            if(kd('N')){
                //hand[com][a[com][1][x[com]-1][y[com]]]++;
                //a[com][1][x[com]-1][y[com]]=0;
                pt(com,1,x[com]-1,y[com],false);
            }
            if(kd('M')){
                //hand[com][a[com][1][x[com]-1][y[com]+1]]++;
                //a[com][1][x[com]-1][y[com]+1]=0;
                pt(com,1,x[com]-1,y[com]+1,false);
            }
        }
        if(!kn){
            if(kd('Y')){
                //hand[com][a[com][1][x[com]+1][y[com]-1]]++;
                //a[com][1][x[com]+1][y[com]-1]=0;
                pt(com,1,x[com]+1,y[com]-1,true);
            }
            if(kd('U')){
                //hand[com][a[com][1][x[com]+1][y[com]]]++;
                //a[com][1][x[com]+1][y[com]]=0;
                pt(com,1,x[com]+1,y[com],true);
            } 
            if(kd('I')){
                //hand[com][a[com][1][x[com]+1][y[com]+1]]++;
                //a[com][1][x[com]+1][y[com]+1]=0;
                pt(com,1,x[com]+1,y[com]+1,true);
            }
            if(kd('H')){
                //hand[com][a[com][1][x[com]][y[com]-1]]++;
                //a[com][1][x[com]][y[com]-1]=0;
                pt(com,1,x[com],y[com]-1,true);
            }
            if(kd('K')){
                //hand[com][a[com][1][x[com]][y[com]+1]]++;
                //a[com][1][x[com]][y[com]+1]=0;
                pt(com,1,x[com],y[com]+1,true);
            }
            if(kd('B')){
                //hand[com][a[com][1][x[com]-1][y[com]-1]]++;
                //a[com][1][x[com]-1][y[com]-1]=0;
                pt(com,1,x[com]-1,y[com]-1,true);
            }
            if(kd('N')){
                //hand[com][a[com][1][x[com]-1][y[com]]]++;
                //a[com][1][x[com]-1][y[com]]=0;
                pt(com,1,x[com]-1,y[com],true);
            }
            if(kd('M')){
                //hand[com][a[com][1][x[com]-1][y[com]+1]]++;
                //a[com][1][x[com]-1][y[com]+1]=0;
                pt(com,1,x[com]-1,y[com]+1,true);
            }
        }
        color(7);
    }
    while(kd('P')){
    }
    cmmd='?';
    while(cmmd!='P' && cmmd!='p'){
        cmmd=getch();
    }
    cmmd='?';
}
int cun(int com)
{
    while(kd(char(13))){
    }
    xuanze=1;
    color(255);
    //for(i=1;i<=1000;i++) cout<<" ";
    if(mode[com]==1){
        survival(com);
    }else if(mode[com]==2){
        create(com);
    }
    return 0;
}
void fm(){
    while(cmmd!='G' && cmmd!='g'){
        system("cls");
        color(240);
        system("cls");
        cout<<endl;
        Line("XACRAFT 3.2");
        cout<<endl<<endl;
        color(249);
        Line(" **组团队\n"); 
        color(240);
        Line("创意/营销/策划    王子逸");
        Line("核心程序/外观设计 沙宸安");
        cout<<endl;
        color(249);
        Line(" 特别鸣谢名单\n"); 
        color(240);
        Line(" 注:以上排名不分先后\n");
        cout<<endl;
        Line("吴庞茂旭  武 建 豪  刘 英 杰  杜 文 博  侯 平 仄");
        Line("欧阳语聪  张    帆  赵 逸 凡  赵 奕 帆  陈    曦");
        Line("许 金 夫  江 齐 悦  孔 小 川  宣 海 宁  王 子 耀");
        Line("陈 喆 鹏  包 涵 宇  潘 孝 宇  曹 灿 阳  朱 优 扬");
        Line("郑 泓 毅  陈 家 傲  李 玥 仑  赵 泰 来  薛 乘 志");
        color(252);
        cout<<endl;
        Line("注:所有在鸣谢名单上的人可以申请移出,达到光能级别及以上的人可以申请加入。");
        color(240);
        Line("[1/2]");
        Line("G-切换下一页");
        cmmd=getch();
    }
    while(cmmd!='S' && cmmd!='s'){
        system("cls");
        color(240);
        system("cls");
        cout<<endl;
        Line("XACRAFT 3.2");
        cout<<endl<<endl;
        color(249);
        Line(" 本版本更新内容\n"); 
        color(240);
        Line("这是XACRAFT的第6个版本");
        Line("本版本更新内容如下:");
        cout<<endl;
        Line("新增生存模式");
        Line("背包堆叠上限");
        Line("存档策略更新");
        cout<<endl;
        color(252);
        Line(" XACRAFT**组团队预祝您游玩愉快!\n");
        color(249);
        Line(" 版权声明\n"); 
        color(240);
        Line("本游戏由兴安科技与极昼游戏工坊联合制作");
        Line("版权所有 未经授权严禁转载 保留所有权利");
        Line("Copyright XAscience & JizhouGameWorkshop All Rights Reserved"); 
        cout<<endl; 
        color(240);
        Line("[2/2]");
        Line("S-开始游戏");
        cmmd=getch();
    }
    while(cmmd!='O' && cmmd!='o'){
        system("cls");
        color(240);
        system("cls");
        if(tecnam.empty()) rightLine("未登录TEC账号  L-登录");
        else rightLine(tecnam+",欢迎您!");
        color(240);
        cout<<"                ▇  ▇   ▇   ▇▇▇ ▇▇▇   ▇   ▇▇▇ ▇▇▇               "<<endl;
        cout<<"                ▇  ▇ ▇  ▇ ▇     ▇  ▇ ▇  ▇ ▇       ▇                 "<<endl;
        cout<<"                  ▇   ▇▇▇ ▇     ▇▇▇ ▇▇▇ ▇▇▇   ▇                 "<<endl;
        cout<<"                ▇  ▇ ▇  ▇ ▇     ▇▇   ▇  ▇ ▇       ▇                 "<<endl;
        cout<<"                ▇  ▇ ▇  ▇ ▇▇▇ ▇  ▇ ▇  ▇ ▇       ▇                 "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                           ";
        color(143);
        cout<<"       F-单人游戏       ";
        color(240);
        cout<<"                            "<<endl; 
        cout<<"                                                                               "<<endl;
        cout<<"                           ";
        color(143);
        cout<<"  G-XACRAFT  Community  ";
        color(240);
        cout<<"                            "<<endl; 
        cout<<"                                                                               "<<endl;
        cout<<"                           ";
        color(143);
        cout<<"       H-个人中心       ";
        color(240);
        cout<<"                            "<<endl; 
        cout<<"                                                                               "<<endl;
        cout<<"                           ";
        color(143);
        cout<<"  J-教程  ";
        color(240);
        cout<<"    "; 
        color(143);
        cout<<"  O-退出  ";
        color(240);
        cout<<"                            "<<endl; 
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<"                                                                               "<<endl;
        cout<<" XACRAFT 3.2        Copyright XAscience & JizhouGameWorkshop Do not distribute!";
        cmmd=getch();
        if(cmmd=='F' || cmmd=='f'){
            while(cmmd!='P' && cmmd!='p'){
                system("cls");
                color(252);
                system("cls");
                Line("我的存档");
                color(240);
                Line("______________________________________________________________________________");
                j=0;
                for(i=1;i<=20;i++){
                    if(jiandang[i]){
                        cout<<" "<<i<<" - XACRAFT存档"<<i<<endl;
                        j++;
                    }
                }
                for(i=1;i<=20-j;i++) cout<<endl;
                Line("______________________________________________________________________________");
                Line("F-新建存档  G-读取存档  H-删除存档  P-退出");
                cmmd=getch();
                if(cmmd=='F' || cmmd=='f'){
                    for(i=1;i<=20;i++){
                        if(!jiandang[i]){
                            nw(i);
                            jiandang[i]=1;
                            break;
                        }
                    }
                }
                if(cmmd=='G' || cmmd=='g'){
                    system("cls");
                    color(252);
                    system("cls");
                    Line("我的存档");
                    color(240);
                    Line("读取存档"); 
                    cout<<endl<<endl;
                    line("存档编号(输入负数退出): ");
                    color(7);
                    cin>>comd;
                    kkk=change_num(comd);
                    comd="?";
                    if(kkk>=0 && jiandang[kkk]){
                        cun(kkk);
                        system("cls");/*
                        color(12);
                        Line("XACRAFT存档异常退出");
                        color(7);
                        cout<<endl<<"    如您跳转到此界面,可能是因为您在使用XACRAFT存档的过程中未进行字符读入(或字符读入已执行但被清除),请输入任意内容,然后按Enter键即可退出XACRAFT存档";
                        cin>>comd;
                        system("cls");*/
                    }
                }
                if(cmmd=='H' || cmmd=='h'){
                    system("cls");
                    color(252);
                    system("cls");
                    Line("我的存档");
                    color(240);
                    Line("删除存档"); 
                    cout<<endl<<endl;
                    line("存档编号(输入负数退出): ");
                    color(7);
                    cin>>comd;
                    kkk=change_num(comd);
                    comd="?";
                    if(kkk>=0) jiandang[kkk]=0;
                }
                /*
                if(jiandang){
                    color(7);
                    cun(1);
                    cmmd='?';
                }else{
                    system("cls");
                    color(252);
                    system("cls");
                    Line("我的存档");
                    color(240);
                    Line("新的世界"); 
                    cout<<endl<<endl;
                    line("输入种子: ");
                    color(7);
                    nw(1);
                    cun(1);
                    cmmd='?';
                    jiandang=1;
                }
                */
            }   
            cmmd='?';
        }
        if(cmmd=='G' || cmmd=='g'){
            system("cls");
            color(252);
            system("cls");
            Line("XACRAFT Community");
            cout<<endl;
            color(240);
            Line("请保证您连接了互联网,否则将无法进入XACRAFT Community。"); 
            system("start https://www.luogu.com.cn/team/35439");
            cout<<endl<<endl<<endl<<endl;
            Line("[按任意键退出]");
            cmmd=getch();
            cmmd='?';
        }
        if(cmmd=='H' || cmmd=='h') mycenter();
        if(cmmd=='L' || cmmd=='l') TEClogin();
        if(cmmd=='J' || cmmd=='j'){
            system("cls");
            color(240);
            system("cls");
            Line("新手教程");
            cout<<endl;
            color(240);
            Line(" 注:以下键位操作大小写皆可\n");
            Line(" W-跳  跃   A-左  走   D-右  走  Q-在脚下放置方块\n");
            Line(" J-建造模式/**模式\n");
            Line(" YUIHKBNM依次为:放置/**{左上角,上方,右上角,左边,右边,左下角,下方,右下角}的方块\n");
            Line(" 游戏区域的正下方为物品栏\n");
            Line(" 更多教程请按K键\n");
            cout<<endl<<endl<<endl;
            Line("[按其他键退出]");
            cmmd=getch();
            if(cmmd=='K' || cmmd=='k') system("start https://docs.qq.com/doc/DWGtxU0RzeFF1UFFn");
            cmmd='?';
        }
        if(cmmd=='#'){
            system("cls");
            color(12);
            system("cls");
            Line("除错模式");
            cout<<endl;
            color(7);
            Line("注:本模式仅供XACRAFT内部人员使用,如果您不是XACRAFT技术人员,在使用XACRAFT除错模式后因操作不当出现问题,兴安科技和极昼工坊将不承担任何责任。");
            cout<<endl<<endl;
            cout<<"方块外观:";
            for(i=1;i<=35;i++){
                print(i);
                color(7);
            }
            color(7);
            cout<<endl<<"方块UI值:";
            for(i=1;i<=35;i++){
                if(i%2==1) color(9);
                printf("%02d",i);
                color(7);
            }
            cout<<endl<<endl<<endl;
            Line("[按任意键退出]");
            cmmd=getch();
            cmmd='?';
        }
    }
    Sleep(1000);
    return ;
}
void exit_saving(){
    sav();
}
void XACRAFT_MAIN(){
    console();
    HideCursor1();
    Logical_Lock();
    lists();
    checkcun();
    rea();
    fm();
}
int main(){
    atexit(exit_saving);
    XACRAFT_MAIN();
    return 0;
}

我的世界

0
0
宋子墨
宋子墨
资深光能
资深光能

#include<iostream>
#include<ctime>
#include<cstdlib>
#include<Windows.h>
using namespace std;
int G=0,L=0;
bool Is_win(int a[])
{
    int c=0,b=0;
    for(int i=1;i<=12;i++)
    {
        if(a[i]==1 && (i!=1 && i!=3 && i!=5 && i!=7))
        {
            c++;
            cout<<"好人:"<<i<<"号 "; 
        }
            
        if(a[i]==1 && (i==1 || i==3 || i==5 || i==7))
        {
            b++;
            cout<<"狼人:"<<i<<"号 "; 
        }
            
    }
    cout<<endl;
    cout<<"(好人已**亡"<<c<<"人)"<<endl;
    cout<<"(狼人已**亡"<<b<<"人)"<<endl;
    G=8-c;
    L=4-b;
    Sleep(1000); 
    cout<<endl;
    if(c>=8)
    {
        cout<<"狼人胜利,**!!"<<endl; 
        return true;
    }
    if(b==4)
    {
        cout<<"好人胜利,驱逐黑暗!!"; 
        return true;
    }
    return false;
}
int main()
{
    //模拟狼人杀
    //7人   2狼  2神(猎人、女巫)  3平民  
    //胜负:狼人全部出局    杀**所有好人   
    
    cout<<"开始随机获取你的身份编号。。。"<<endl;
    Sleep(2000); 
    int r;
    srand(time(0));
    r = rand()%12+1;  //1~12
    cout<<"你的身份编号是"<<r<<",";
    if(r==1 || r==3 || r==5 || r==7)
    {
        cout<<"你是狼人"<<endl; 
    }
    else if(r==2)
    {
        cout<<"你是猎人"<<endl; 
    }
    else if(r==6)
    {
        cout<<"你是女巫"<<endl; 
     } 
     else if(r==4)
     {
        cout<<"你是预言家"<<endl;
     }
     else if(r==10)
     {
        cout<<"你是守卫"<<endl;
     }
     else
     {
        cout<<"你是平民"<<endl; 
     }
    Sleep(2000);
    cout<<endl;
    //对局开始
    //第一个白天,各自发言  进行判断
    bool win=false,gun=false;
    
    int C[13]={0};   //**亡者墓地 
    int c1=0,c2=0;  //女巫药水
    int K=0;
    int S=0;  //救命药给了谁 
    int t=0,t2=0;  //毒药,救命药是否生效
 
    for(int i=1;!win;i++)
    {
        int p=0;  //守卫守护的人
        int y=0;  //预言的人 
        int T=0;
        
        cout<<"第"<<i<<"个夜晚来临。。。。"<<endl;
        Sleep(2000);
         
        if(i>=2 && C[6]!=1) //女巫环节 
        {
            if(r==6)
            {
                cout<<"你是女巫,今晚是否要使用毒药(1或0)"<<endl; 
                int d;
                cin>>d;
                if(d==1)
                {
                    if(t==0)
                    {
                        cout<<"你决定使用毒药。。。。"<<endl; 
                        Sleep(1500);
                        d=6;
                        for(int j=1;d==6||C[d]==1;j++)  //毒** 
                        {
                            d = rand()%12+1;
                        }
                        c2=d;
                        Sleep(2000); 
                    }
                    else
                    {
                        cout<<"你已经使用了毒药"<<endl;
                     } 
                }
                
                cout<<"你是女巫,今晚是否要使用救命药(1或0)"<<endl; 
            
                cin>>d;
                if(t2==0)
                {
                    if(d==1) //使用救命药 
                    {
                        cout<<"你使用了救命药。。。。。"<<endl; 
                        Sleep(1000);
                        d=rand()%12+1;
                        for(int j=1;C[d]!=1;j++)
                        {
                            d = rand()%12+1;
                        }
                        S=d;
                        cout<<"(救命药给了"<<S<<"号)"<<endl; 
                    }
                }
                else
                {
                    if(t2==1)
                    {
                        cout<<"你已经用过了救命药"<<endl; 
                        Sleep(1000); 
                    }
                 } 
            }
            else
            {
                int d=rand()%5+1;
                
                if(d>3 && t==0)
                {
                    cout<<"女巫使用了毒药。。。。"<<endl; 
                    Sleep(1500);
                    d=6;
                    for(int j=1;d==6||C[d]==1 || C[d]==2;j++)  //毒** 
                    {
                        d = rand()%12+1;
                    }
                    c2=d;
                    
                    Sleep(1000);
                     
                    d=rand()%5+1;
                    if(d>3 && t2==0)
                    {
                        c1=rand()%5+1;
                        if(c1<3) //使用救命药 
                        {
                            cout<<"女巫使用了救命药。。。。"<<endl; 
                            Sleep(1000);
                            
                            d=rand()%12+1;
                            for(int j=1;C[d]==1;j++)
                            {
                                d = rand()%12+1;
                            }
                            S=d;
                            cout<<"(救命药给了"<<S<<"号)"<<endl;
                        }
                    } 
                    
                    Sleep(2000); 
                }   
            }
            
        }
        
        if(r==4)
        {
            
            if(C[4]!=1)  //预言家环节 
            {
                cout<<"你是预言家,今晚是否要查验他人身份(1或0)"<<endl; 
                int d;
                cin>>d;
                if(d==1)
                {
                    cout<<"你决定查验他人身份。。。。"<<endl; 
                    Sleep(1500);
                    d=4;
                    for(int j=1;d==4||C[d]==1;j++)  //查人 
                    {
                        d = rand()%12+1;
                    }
                    y=d; 
                    cout<<"(你查到"<<y<<"号是,";
                    if(y==1 || y==3 || y==5 || y==7)
                    {
                        cout<<"狼人。"<<endl;
                     } 
                    else if(y==2)
                    {
                        cout<<"猎人。"<<endl;
                    }
                    else if(y==10)
                    {
                        cout<<"守卫。"<<endl;
                        
                    }
                    else
                    {
                        cout<<"平民。"<<endl; 
                    }
                
                    Sleep(2000); 
                    
                } 
            } 
        }
        else
        {
            
            if(C[4]!=1)
            {
                cout<<"预言家验人。。。。"<<endl; 
                Sleep(1500);
                int d=4;
                for(int j=1;d==4||C[d]==1 || C[d]==2;j++)   
                {
                    d = rand()%12+1;
                }
                y=d; 
            }
        }
         
        if(r==10)
        {
            if(C[10]!=1)  //守卫环节 
            {
                cout<<"你是守卫,今晚是否要守护他人(1或0)"<<endl; 
                int d;
                cin>>d;
                if(d==1)
                {
                    cout<<"你决定守护他人。。。。"<<endl; 
                    Sleep(1500);
                    if(C[4]==2)
                    {
                        d=4;
                    }
                    else if(C[6]==2)
                    {
                        d=6;
                    }
                    else
                    {
                        d=10;
                        for(int j=1;d==10||C[d]==1;j++)  //守人 
                        {
                            d = rand()%12+1;
                        }
                    }
                    
                    p=d; 
                    
                    Sleep(2000);    
                }
                cout<<"(守护了"<<p<<"号)"<<endl;
            }
            
        }
        else
        {
            if(C[10]!=1)
            {
                int d; 
                cout<<"守卫守护他人。。。。"<<endl; 
                Sleep(1500);
                if(C[4]==2)
                {
                    d=4;
                }
                else if(C[6]==2)
                {
                    d=6;
                }
                else
                {
                    d=10;
                    for(int j=1;d==10||C[d]==1;j++)  //守人 
                    {
                        d = rand()%12+1;
                    }
                }
                p=d; 
                
             } 
            cout<<"(守护了"<<p<<"号)"<<endl;
            Sleep(2000); 
            
        } 
        cout<<endl;
         
        int a=1,b;
        if(K!=0 && C[K]!=1)
        {
            a=K;
        }
        else
        {
            for(int j=1;a==1||a==3||a==5||a==7||C[a]==1;j++)  //遇害人 
            {
                a = rand()%12+1;
            }
        }
        
        
        if(p==a)
        {
            a=1;
        }
        else if(S==a && t2==0)
        {
            a=1;
            t2=1;
        }
        else
        {
            C[a]=1; //**亡
        }
        
        
        //白天  **亡通知 
        cout<<"天亮了,昨晚";
        if(a!=1)
        {
            if(a==2)
            {
                cout<<"猎人遇害"<<endl;
                gun=true;
            }
            else if(a==6)
            {
                cout<<"女巫遇害"<<endl;
            }
            else if(a==4)
            {
                cout<<"预言家遇害"<<endl;
            }
            else if(a==10)
            {
                cout<<"守卫遇害"<<endl;
            }
            else
            {
                cout<<"平民遇害"<<endl; 
            }
            
            if(c2!=0 && t==0)
            {
                if(c2==1 || c2==3 || c2==5 || c2==7)
                {
                    cout<<"狼人被毒杀"<<endl;
                 } 
                else if(c2==2)
                {
                    cout<<"猎人被毒杀"<<endl;
                    gun=true;
                }
                else if(c2==4)
                {
                    cout<<"预言家被毒杀"<<endl;
                    
                }
                else if(c2==10)
                {
                    cout<<"守卫被毒杀"<<endl;
                    
                }
                else
                {
                    cout<<"平民被毒杀"<<endl; 
                }
                C[c2]=1;
                t=1;
            }   
        }
        else
        {
            cout<<"平安夜"<<endl;
        }
        cout<<endl;
        
        
        
        
        win=Is_win(C);
    
        if(win)
        {
            break;
        }    
        
        Sleep(2000);
        cout<<"开始进行发言"<<endl; 
        Sleep(2000);
        
        if(C[1]!=1)
        {
            cout<<"1号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        }
        if(C[2]!=1)
        {
            cout<<"2号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        }
        if(C[3]!=1)
        {
            cout<<"3号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        }
         
        //发言
        if(r==4)
        {
            if(C[4]!=1)  //预言家环节 
            {
                cout<<"你是预言家,是否亮明自己的身份(1或0)"<<endl; 
                int d;
                cin>>d;
                if(d==1)
                {
                    if(y!=0)
                    {
                        cout<<"4号:我是预言家,昨天晚上验人了,"<<y<<"号"<<endl; 
                        Sleep(1500);
                        if(y==1 || y==3 || y==5 || y==7)
                        {
                            cout<<"他是狼人"<<endl;
                         } 
                        else if(y==2)
                        {
                            cout<<"他是猎人"<<endl;
                        }
                        else if(y==6)
                        {
                            cout<<"他是女巫"<<endl;
                        }
                        else if(y==10)
                        {
                            cout<<"他是守卫"<<endl; 
                        }
                        else
                        {
                            cout<<"他是平民"<<endl; 
                        }
                        if(C[10]!=1)
                            cout<<"守卫今天晚上注意保护我!"<<endl;
                        if(C[6]!=1)
                            cout<<"或者女巫可以考虑把救命药给我。"<<endl;
                             
                        if(C[4]!=2)
                        {
                            if(rand()%3+1==1)
                            {
                                cout<<"(大家相信了)"<<endl;
                                K=4;
                                C[4]=2;
                                if(y==1 || y==3 || y==5 || y==7)
                                {
                                    T=y;
                                }
                                else
                                {
                                    C[y]=2;
                                }
                            }
                            else
                            {
                                cout<<"(大家没有相信)"<<endl;
                            }
                        }
                        else
                        {
                            cout<<"(大家相信预言家了。。。。)"<<endl;
                            K=4;
                            if(y==1 || y==3 || y==5 || y==7)
                            {
                                T=y;
                            }
                            else
                            {
                                C[y]=2;
                            }
                        }   
                    }
                    else
                    {
                        cout<<"4号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
                    } 
                        
                    Sleep(2000); 
                }
                else
                {
                    cout<<"4号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
                 } 
            }
        }
        else
        {
            if(C[4]!=1)  //预言家环节 
            { 
                if(y!=0)
                {
                    cout<<"4号:自己是预言家,昨天晚上验人了,"<<y<<"号"<<endl; 
                    Sleep(1500);
                    if(y==1 || y==3 || y==5 || y==7)
                    {
                        cout<<"他是狼人"<<endl;
                     } 
                    else if(y==2)
                    {
                        cout<<"他是猎人"<<endl;
                    }
                    else if(y==6)
                    {
                        cout<<"他是女巫"<<endl;
                    }
                    else if(y==10)
                    {
                        cout<<"他是守卫"<<endl; 
                    }
                    else
                    {
                        cout<<"他是平民"<<endl; 
                    }
                    
                    if(C[4]!=2)
                    {
                        if(rand()%3+1==1)
                        {
                            cout<<"(大家相信了)"<<endl;
                            K=4;
                            C[4]=2;
                            if(y==1 || y==3 || y==5 || y==7)
                            {
                                T=y;
                            }
                            else
                            {
                                C[y]=2;
                            }
                        }
                        else
                        {
                            cout<<"(大家没有相信)"<<endl;
                        }
                    } 
                    else
                    {
                        cout<<"(大家相信预言家了。。。。)"<<endl;
                        K=4;
                        if(y==1 || y==3 || y==5 || y==7)
                        {
                            T=y;
                        }
                        else
                        {
                            C[y]=2;
                        }
                    } 
                }
                else
                {
                    cout<<"4号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
                } 
                    
                Sleep(2000);    
            }
        }
        
        if(C[5]!=1)
        {
            cout<<"5号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        if(C[6]!=1)
        {
            cout<<"6号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        if(C[7]!=1)
        {
            cout<<"7号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        if(C[8]!=1)
        {
            cout<<"8号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        if(C[9]!=1)
        {
            cout<<"9号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        if(r==10)
        {
            if(C[10]!=1)  //守卫环节 
            {
                cout<<"你是守卫,是否亮明自己的身份(1或0)"<<endl; 
                int d;
                cin>>d;
                if(d==1)
                {
                    cout<<"10号:我是守卫,我昨天晚上守护了"<<p<<"号"<<endl; 
                    Sleep(1500);
                    if(C[4]!=1)
                    {
                        cout<<"我今天晚上会守护预言家"<<endl; 
                    }
                    else
                    {
                        cout<<"我今晚会守护好人"<<endl;
                    }
                    
                    if(rand()%3+1==2)
                    {
                        cout<<"(大家相信了)"<<endl;
                        K=10;
                        C[10]=2;
                        C[p]=2;
                    }
                    else
                    {
                        cout<<"(大家没有相信)"<<endl;
                    }
                }
                else
                {
                    cout<<"10号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
                 } 
            }
        }
        else
        {
            if(C[10]!=1)  //守卫环节 
            {
            
                if(p!=0)
                {
                    cout<<"10号:自己是守卫,自己昨天晚上守护了"<<p<<"号"<<endl; 
                    Sleep(1500);
                    if(C[4]==2)
                    {
                        cout<<"今天晚上会守护预言家"<<endl; 
                    }
                    else
                    {
                        cout<<"今晚会守护好人"<<endl;
                    }
                    
                    if(rand()%3+1==1)
                    {
                        cout<<"(大家相信了)"<<endl;
                        K=10;
                        C[10]=2;
                        C[p]=2;
                    }
                    else
                    {
                        cout<<"(大家没有相信)"<<endl;
                    }
                }
            }
        }
        
        if(C[11]!=1)
        {
            cout<<"11号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        if(C[12]!=1)
        {
            cout<<"12号:几里哇啦几里哇啦%&……%*&%&*"<<endl;
            Sleep(1000);
        } 
        cout<<endl;
        
        
        Sleep(2000);
        cout<<"开始进行票选"<<endl; 
        Sleep(2000); 
        //票选 
        
        if(T==0)
        {
            if(L>G)
            {
                a = rand()%12+1;
                for(int j=1;a==1||a==3||a==5||C[a]==1;j++)  //票选 
                {
                    a = rand()%12+1;
                }
            }
            else
            {
                a = rand()%12+1;
                for(int j=1;C[a]==1 || C[a]==2;j++)  //票选 
                {
                    a = rand()%12+1;
                }
            }
            
        }
        else
        {
            a=T;
            
        }
        
        
        if(a==1 || a==3 || a==5 || a==7)
        {
            cout<<"狼人被票选"<<endl;
         } 
        else if(a==2)
        {
            cout<<"猎人被驱逐"<<endl;
            gun=true;
        }
        else if(a==6)
        {
            cout<<"女巫被驱逐"<<endl;
        }
        else if(a==4)
        {
            cout<<"预言家被驱逐"<<endl;
        }
        else if(a==10)
        {
            cout<<"守卫被驱逐"<<endl;
        }
        else
        {
            cout<<"平民被驱逐"<<endl; 
        }
        C[a]=1; //驱逐
        Sleep(2000); 
        if(gun)
        {
            cout<<"猎人开枪!"<<endl;
            Sleep(1500);
            //猎人遇害开枪带走一个
            for(int j=1;C[a]==1||C[a]==2 ;j++)  
            {
                a = rand()%12+1;
            }
            if(a==1 || a==3 || a==5 || a==7)
            {
                cout<<"狼人被枪杀"<<endl;
            } 
            else if(a==4)
            {
                cout<<"预言家被枪杀"<<endl;
            }
            else if(a==10)
            {
                cout<<"守卫被枪杀"<<endl;
            }
            else if(a==6)
            {
                cout<<"女巫被枪杀"<<endl;
            }
            else
            {
                cout<<"平民被枪杀"<<endl; 
            }
            C[a]=1;
            gun=false; 
            Sleep(2000);
        }
        win=Is_win(C);  
    }
             
}

0
0
0
我要回答