栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

c++做走迷宫游戏

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

c++做走迷宫游戏

这是我第一次用MD编辑器,感觉有种用野生编辑器写html的感觉 但是一些html的标签还是用不了 本来认为这就是一种类似于html的写法,后来一搜才发现...是我想少了 随便一搜,好家伙,直接出来十几万字的教程 此刻,我终于明白了那些时间复杂度类似于nn这样的东西是怎么打出来的了 hhhhh
直接进入正题!这个代码是别人给我让我改的,然后我就给这个代码基本重新写了一遍...
不得不说,这bug是真多呀。。。虽然原作者给了我发原创的权利,但是还是附上原文地址,有兴趣可以比较一下代码,改的地方还是挺多的 [原文](https://blog.csdn.net/klaudius/article/details/123015248?spm=1001.2014.3001.5501) 代码:
#include
#include
#include
using namespace std;
long long s=1,shengming=20,bushu=0,leiren,lx1,ly1,lx,ly;
const long long n=59,jg=25,dengji=0;
bool yaoshi=0,leiren2;
string p=" M!|=.123456789%&_~£Win";
long long r=1;
char f='y';
void color(int a)//打印颜色
{
    if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
    if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
    if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
    if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
    if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
    if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
    if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
    if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
    if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
long long numberaio(string n){
    for (int i = 0; i < 100000; i++) {
        if(n[i]=='')
        {
            return i;
        }
    }
}
void coutAIO(string b,int truefalse0 = 1,bool truefalse1 = 0){
    int i=0,s=0;
    long long a=numberaio(b);
    while(a!=0){
        s=rand()%9;
        if(a!=0&&s==0)
        {
            color(0);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==1)
        {
            color(1);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==2)
        {
            color(2);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==3)
        {
            color(3);
            cout << b[i];
            a--;
            i++;
            if(truefalse0!=false){
                Sleep(20);
            }
        }
        if(a!=0&&s==4)
        {
            color(4);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==5)
        {
            color(5);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==6)
        {
            color(6);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==7)
        {
            color(7);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==8)
        {
            color(8);
            cout << b[i];
            a--;
            i++;
        }
        if(truefalse0 ==1){
            Sleep(10);
        }
        if(truefalse0 ==2){
            Sleep(20);
        }
        if(truefalse0 ==3){
            Sleep(40);
        }
        if(truefalse0 ==4){
            Sleep(100);
        }
        if(truefalse0 ==5){
            Sleep(300);
        }
        if(truefalse0 ==6){
            Sleep(1000);
        }
    }
    if(truefalse1!=false){
        getch();
        system("cls");
    }
    cout << endl;
}
void ksjm()
{
    system("color f0");
    cout<<"按任意键开始游戏...";
    getch();
    system("cls");
    for(long long i=1;i<=3;i++)
    {
        system("color 07");
        system("color 10");
        system("color 20");
        system("color 30");
        system("color 40");
        system("color 50");
        system("color 60");
        system("color 70");
        system("color 80");
        system("color 90");
        system("color a0");
        system("color b0");
        system("color c0");
        system("color d0");
        system("color e0");
        system("color f0");
    }
    cout<<"nnnnnnnnnnn                                                      ";
    coutAIO("走迷宫",2);
    cout<<"n";
    cout<<"                                                   ";
    coutAIO("出品:饼干,修改:努力的AIO bug修复及优化:YR_T",5);
    Sleep(1500);
}
void start(int n)
{
    system("cls");
    cout<<"加载中请稍等";
    Sleep(1000);
    system("cls");
    for (int i=1;i<=n; i++)
    {
        cout<<"加载中."<jg)r=1;
    }
    system("cls");
    return ;
}
void sm()//说明
{
    system("cls");
    cout<<"nn        游戏说明:nnn";
    cout<<"                    按空格开始游戏后n";
    cout<<"                      Wn";
    cout<<"                    A S Dn";
    cout<<"                    移动n";
    cout<<"                    M是你n";
    cout<<"                       按R键返回起点n";
    cout<<"                       按P键返回主界面n";
    cout<<"                       按Q键设立传送点n";
    cout<<"                       按E键返回传送点n";
    cout<<"                       Z处为终点n";
    cout<<"                       -号处为左右穿刺,可到另一头,但减血5滴n";
    cout<<"                       *号处为炸药n";
    cout<<"                       #号处为障碍物n";
    cout<<"                       ?号处为可清理障碍物n";
    cout<<"                       V处为下刺n";
    cout<<"                       <处为左刺n";
    cout<<"                       >处为右刺n";
    cout<<"                       ^处为上刺n";
    cout<<"                       @处为钥匙n";
    cout<<"                       +号处为加血n";
    cout<<"                       0处为死地(不可复活且每个普通关只有一个,BOSS关有五个,超级BOSS关有10个以上)n";
    cout<<"            新手指导说明:n";
    cout<<"                       目前猎人正在测试,可能不稳定,敬请谅解nnn";
    cout<<"            按空格继续···";
    long long ok='';
    while(ok=getch(),ok!=' ');
    system("cls");
    return ;
}
void full_screen()
{   
    HWND hwnd = GetForegroundWindow();
    int cx = GetSystemMetrics(SM_CXSCREEN);            
    int cy = GetSystemMetrics(SM_CYSCREEN);            

    LONG l_WinStyle = GetWindowLong(hwnd,GWL_STYLE);   
    
    SetWindowLong(hwnd,GWL_STYLE,(l_WinStyle | WS_POPUP | WS_MAXIMIZE) & ~WS_CAPTION & ~WS_THICKframe & ~WS_BORDER);

    SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, 0);
}
void hys()//背景
{
    system("cls");
    cout<<"nnnnnnnnn      按1【日间色】n";
    cout<<"      按2【夜间色】n";
    cout<<"      按3【黑客】n";
    cout<<"      按4【科幻】n";
    cout<<"      按5【紫水晶】n";
    cout<<"		 按6【简约色】n";
    cout<<"      按7【深邃蓝】n";
    char s;
    s=getch();
    while(s!='1'&&s!='2'&&s!='3'&&s!='4'&&s!='5'&&s!='6'&&s!='7')s=getch();
    switch(s-'0')
    {
        case 1:
            system("color f0");
            break;
        case 2:
            system("color 0f");
            break;
        case 3:
            system("color 0a");
            break;
        case 4:
            system("color 09");
            break;
        case 5:
            system("color 01");
            break;
        case 6:
        	system("color 8f");
        	break;
        case 7:
        	system("color 12");
        	break;
    }
    system("cls");
    return ;
}
void xsjc()//新手教程 
{
	char xxx[100][100]={
		"#############",
		"#M          #",
		"#           #",
		"#    O      #",
		"#           #",
		"#%          #",
		"#           #",
		"#############"
	};
	for(int i=0;i<=10;i++)
		puts(xxx[i]);
	coutAIO("新手引导:试着移动!",3);
	coutAIO("(O是炸弹,%是猎人)",3);
	cout<>ytytyty;
	if (ytytyty=="要") {
		full_screen();
	}
    system("color f0");
    coutAIO("你眼里作者们帅不帅?",3);
    string a;
    cin >> a;
    if(a=="太帅了"||a=="帅"||a=="帅死了"||a=="帅!"||a=="帅!"){
        coutAIO("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈……");
        Sleep(1000);
        system("cls");
        coutAIO("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈……");
        Sleep(1000);
        system("cls");
        coutAIO("游戏正式开始!!!!!",5);
    }
    else{
        coutAIO("不会代码一边去!!!!!!!!!!!!!!");
        goto dad;
    }
    start(4);
    while(1)
    {
        long long xx=1,yy=1;
        system("cls");
        f='y';
        cout<<"nnnnnnnnnnn";
        cout<<"                                                      迷宫游戏,注意全屏n";
        cout<<"                                                   按空格开始游戏n";
        cout<<"                                                    按0退出游戏n";
        cout<<"                                                    按1换皮肤n";
        cout<<"                                                    按2游戏说明n";
        cout<<"                                                    按3换颜色n";
        cout<<"n";
        cout<<"                                                     原创:饼干 改编:努力的AIO bug修复及优化:YR_T";
        long long ok=getch();
        while(ok!='0'&&ok!='1'&&ok!='2'&&ok!=' '&&ok!='3')ok=getch();
        switch(ok)
        {
            case ' ':
                break;
            case '0':
                tc();
                return 0;
                break;
            case '1':
                hf();
                f='n';
                break;
            case '2':
                sm();
                f='n';
                break;
            case '3':
                hys();
                f='n';
                break;
        }
        while(f=='y')
        {
            system("cls");
            string a[n];
            long long x,y,qx,qy;
            long long ch;
            srand(time(0));
            int oplen=0;
            switch(s) 
            {
                case 1:
                	xsjc();
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="###########";
                    a[1]="#   *   #@#";
                    a[2]="# #   #   #";
                    a[3]="# ##0## ###";
                    a[4]="# #???###Z#";
                    a[5]="#???#?????#";
                    a[6]="###########";
                    a[7]="##障碍之地#";
                    a[8]="###########";
                    oplen=8;
                    break;
                case 2:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=8;
                    qy=12;
                    a[0]="####################";
                    a[1]="#Z   #       #     #";
                    a[2]="# ##   #### ###  # #";
                    a[3]="#  ####      ##### #";
                    a[4]="###   # # ##       #";
                    a[5]="##### #######V##@# #";
                    a[6]="#     ## ###   <#  #";
                    a[7]="## ##^   <## 0 ## ##";
                    a[8]="#      <     #     #";
                    a[9]="####################";
                   a[10]="######黑暗森林######";
                   a[11]="####################";
                   oplen=11;
                    break;
                case 3:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="###V###V#V#V###0###";
                    a[1]="# #   #   #   #   #";
                    a[2]="# # # # # # # # # #";
                    a[3]="# # # # # # # # # #";
                    a[4]="# # # # # # # # # #";
                    a[5]="# - - - - - - - - #";
                    a[6]="# # # # # # # # # #";
                    a[7]="# # # # # # # # # #";
                    a[8]="# # # # < # # # # #";
                    a[9]="# # # # # # # # # #";
                   a[10]="#   #   # @ #   #Z#";
                   a[11]="#^#^#^#^#^#^#^#^###";
                   a[11]="#^#^#^#^小心1^#^###";
                   a[11]="#^#^#^#^#^#^#^#^###";
                   oplen=11;
                    break;
                case 4:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="#####################V################V#";
                    a[1]="#                                      #";
                    a[2]="# ###*###################*############ #";
                    a[3]="# #                                  # #";
                    a[4]="# # #####0########*####### ##### ####V*#";
                    a[5]="# # #Z        #     #    # ##*         #";
                    a[6]="# # # # # ##*###### # #### ##  #### ## #";
                    a[7]="# # # # # ##        #      ## ##  #  # #";
                    a[8]="# # # ### ## # # ########### ##  ##  # #";
                    a[9]="# # # # #    # # # #       @#    #   # #";
                   a[10]="# # ### ###### ### # ######## ##### ## #";
                   a[11]="# # * #        -   #              #  # #";
                   a[12]="# # # ######## ############## #####  # #";
                   a[13]="# # >                                # #";
                   a[14]="# # ######*########################### #";
                   a[15]="# #                                  # #";
                   a[16]="# #############V########*#######^##### #";
                   a[17]="#                                      *";
                   a[18]="#*#######################*##############";
                   a[19]="#*###########小心2#######*##############";
                   a[20]="#*#######################*##############";
                   oplen=20;
                    break;
                case 5:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="########################################";
                    a[1]="#                      #               #";
                    a[2]="# <########## ################# ###### #";
                    a[3]="#           # #               # ##   # #";
                    a[4]="# # # #### ## # ## # #### ##### ## # # #";
                    a[5]="# # # #       #  # #    #        # # # #";
                    a[6]="# # #  #### ###### ############### #   #";
                    a[7]="# # ##    #      # >               # # #";
                    a[8]="# #  #### ######## <^^^^^^^####### # # #";
                    a[9]="# ##    #      0 # < BOSS关VVVV>   # # #";
                   a[10]="#    ######### #   < 危险  >     ### # #";
                   a[11]="#*#     #        # < 地带 1> ##### # # #";
                   a[12]="#   <#############VVVVVVVVV> #     # # #";
                   a[13]="# # #                        # ## #  ###";
                   a[14]="# ### #### ######>  <#######^# #### 0# #";
                   a[15]="#     #    #                      #   Z#";
                   a[16]="##################00###############0####";
                   oplen=16;
                    break;
                case 6:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="##########################";
                    a[1]="#                        #";
                    a[2]="# ###################### #";
                    a[3]="# #*   *   *   *   *   * #";
                    a[4]="# #  *   *   *   *   *   #";
                    a[5]="### #####################";
                    a[6]="#                        #";
                    a[7]="# ###################### #";
                    a[8]="# >               *   *# #";
                    a[9]="#@# ####*####*  *   *    #";
                   a[10]="##           Z############";
                   a[11]="##0##*####################";
                   a[12]="##^##*######地雷阵1#######";
                   a[13]="##^##*####################";
                   oplen=13;
                    break;
                case 7:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="#############################################################";
                    a[1]="# ###+#                                                   #+#";
                    a[2]="# #  ###### ##############################################  #";
                    a[3]="# # # #   # #                                             ###";
                    a[4]="# # # # # #   # ########################################### #";
                    a[5]="# # # # # ##### #                                           #";
                    a[6]="# # # # #       # ######################################### #";
                    a[7]="# # # # #########                                         # #";
                    a[8]="# # # # ################################################  # #";
                    a[9]="# # # # #***********************************************#*# #";
                   a[10]="# # # # #ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ # #";
                   a[11]="# # # # #***********************************************# # #";
                   a[12]="# # # # ################################### ############# # #";
                   a[13]="# # # # #                                  #           ## # #";
                   a[14]="# # # # # ##### ###############0# ####################    # #";
                   a[15]="# # # # # #  ## #               # #   *   *   *   *   *## # #";
                   a[16]="# # # # # #+#   # ############# # # *   *   *   *   *     * #";
                   a[17]="# # # # # #######  #   #   #  # # # ####################### #";
                   a[18]="# # #+# #            #   #  #+# #      #################### #";
                   a[19]="# # ### ####################### ########################### #";
                   a[20]="#                                                           #";
                   a[21]="#^###########################################################";
                   a[21]="#^########################地雷阵2######注意生命大于十三######";
                   a[21]="#^###########################################################";
                   oplen=21;
                   break;
                case 8:
                    if(shengming!=20)
                    {
                        shengming++;
                    }
                    qx=1;
                    qy=1;
                    a[0]="#############################################################";
                    a[1]="# ###                                                     #@#";
                    a[2]="# #   ##### ##############################################  #";
                    a[3]="# # # #   # #                                              0#";
                    a[4]="# # # # # #   # ##########################################  #";
                    a[5]="# # # # # ##### #                                           #";
                    a[6]="# # # # #       - ######################################### #";
                    a[7]="# # # # #########                                         # #";
                    a[8]="# # # # ################################################  # #";
                    a[9]="# # # # #+++++++++++++++++++++_______+++++++++++++++++++### #";
                   a[10]="# # # # #+++++++++++++++++++++|死|地|++++++++++++++++++** # #";
                   a[11]="# # # # #+++++++++++++++++++++|__|__|+++++++++++++++++++# # #";
                   a[12]="# # # # ######################VVVVVVV#############V###### # #";
                   a[13]="# # # # #                                              ## # #";
                   a[14]="# # # # # #####V######################################    # #";
                   a[15]="# < < < < #  ##                   <   <   <   <   <   *## # #";
                   a[16]="# # # # # #+#   # ############# <   <   <   <   <   < Z>    #";
                   a[17]="# # # # # ##### ')
                {
                    coutAIO("你被刺扎了,扣血4滴");
                    shengming-=4;
                    system("pause");
                }
                if(ch=='s'&&a[x+1][y]=='^')
                {
                    coutAIO("你被刺扎了,扣血4滴");
                    shengming-=4;
                    system("pause");
                }
                if((ch=='a'&&a[x][y-1]=='+')||(ch=='d'&&a[x][y+1]=='+')||(ch=='s'&&a[x+1][y]=='+')||(ch=='w'&&a[x-1][y]=='+'))
                {
                    if(shengming>=20)
                    {
                        coutAIO("你加不了血!");
                        goto flag;
                    }
                    coutAIO("你加了血!你加了一滴血!");
                    shengming+=1;
                    if(ch=='a'&&a[x][y-1]=='+')
                    {
                        a[x][y-1]=' ';
                    }
                    if(ch=='d'&&a[x][y+1]=='+')
                    {
                        a[x][y+1]=' ';
                    }
                    if(ch=='s'&&a[x+1][y]=='+')
                    {
                        a[x+1][y]=' ';
                    }
                    if(ch=='w'&&a[x-1][y]=='+')
                    {
                        a[x-1][y]=' ';
                    }
                    system("pause");
                }
                flag:
                if((ch=='a'&&a[x][y-1]=='@')||(ch=='d'&&a[x][y+1]=='@')||(ch=='s'&&a[x+1][y]=='@')||(ch=='w'&&a[x-1][y]=='@'))
                {
                    system("cls");
                    coutAIO("你得到了钥匙!!");
                    yaoshi=true;
                    if(ch=='a'&&a[x][y-1]=='@')
                    {
                        a[x][y-1]=' ';
                    }
                    if(ch=='d'&&a[x][y+1]=='@')
                    {
                        a[x][y+1]=' ';
                    }
                    if(ch=='s'&&a[x+1][y]=='@')
                    {
                        a[x+1][y]=' ';
                    }
                    if(ch=='w'&&a[x-1][y]=='@')
                    {
                        a[x-1][y]=' ';
                    }
                    system("pause");
                }
                int d=rand()%100;
                bool s=false;
                if((d<=30&&ch=='a'&&a[x][y-1]=='D')||(d<=20&&ch=='d'&&a[x][y+1]=='D')||(d>=50&&ch=='s'&&a[x+1][y]=='D')||(d>=70&&ch=='w'&&a[x-1][y]=='D')||(d<=50&&a[x][y]=='D'))
                {
                    s=true;
                }
                if(s){
                    shengming--;
                }
                if((ch=='a'&&a[x][y-1]=='+')||(ch=='d'&&a[x][y+1]=='+')||(ch=='s'&&a[x+1][y]=='+')||(ch=='w'&&a[x-1][y]=='+'))
                {
                    coutAIO("你加了血!你加了一滴血!");
                    shengming+=1;
                    if(ch=='a'&&a[x][y-1]=='+')
                    {
                        a[x][y-1]=' ';
                    }
                    if(ch=='d'&&a[x][y+1]=='+')
                    {
                        a[x][y+1]=' ';
                    }
                    if(ch=='s'&&a[x+1][y]=='+')
                    {
                        a[x+1][y]=' ';
                    }
                    if(ch=='w'&&a[x-1][y]=='+')
                    {
                        a[x-1][y]=' ';
                    }
                    system("pause");
                }
                if((ch=='a'&&a[x][y-1]=='*')||(ch=='d'&&a[x][y+1]=='*')||(ch=='s'&&a[x+1][y]=='*')||(ch=='w'&&a[x-1][y]=='*'))
                {
                    coutAIO("你触发了炸药!你被炸药炸到了,扣血10滴");
                    shengming-=10;
                    if(ch=='a'&&a[x][y-1]=='*')
                    {
                        a[x][y-1]=' ';
                    }
                    if(ch=='d'&&a[x][y+1]=='*')
                    {
                        a[x][y+1]=' ';
                    }
                    if(ch=='s'&&a[x+1][y]=='*')
                    {
                        a[x+1][y]=' ';
                    }
                    if(ch=='w'&&a[x-1][y]=='*')
                    {
                        a[x-1][y]=' ';
                    }
                    system("pause");
                }
                if((ch=='a'&&a[x][y-1]=='-')||(ch=='d'&&a[x][y+1]=='-'))
                {
                    a[x][y]=' ';
                    coutAIO("你被刺穿了,扣血5滴,但穿越了");
                    shengming-=5;
                    system("pause");
                    if(ch=='a'&&a[x][y-1]=='-')
                    {
                        a[x][y-=2];
                    }
                    if(ch=='d'&&a[x][y+1]=='-')
                    {
                        a[x][y+=2];
                    }
                }
                if((ch=='a'&&a[x][y-1]=='0')||(ch=='d'&&a[x][y+1]=='0')||(ch=='s'&&a[x+1][y]=='0')||(ch=='w'&&a[x-1][y]=='0'))
                {
                    system("cls");
                    coutAIO("你在下一回合会死去!!");
                    shengming=0;
                    if(ch=='a'&&a[x][y-1]=='0')
                    {
                        a[x][y-1]=' ';
                    }
                    if(ch=='d'&&a[x][y+1]=='0')
                    {
                        a[x][y+1]=' ';
                    }
                    if(ch=='s'&&a[x+1][y]=='0')
                    {
                        a[x+1][y]=' ';
                    }
                    if(ch=='w'&&a[x-1][y]=='0')
                    {
                        a[x-1][y]=' ';
                    }
                    system("pause");
                }
                if(ch==27)break;
                if(ch==97&&a[x][y-1]==' '||a[x][y-1]=='D')
                {
                    a[x][y]=' ';
                    y--;
                    a[x][y]=p[r];
                }
                if(ch==100&&a[x][y+1]==' '||a[x][y-1]=='D')
                {
                    a[x][y]=' ';
                    y++;
                    a[x][y]=p[r];
                }
                if(ch==115&&a[x+1][y]==' '||a[x][y-1]=='D')
                {
                    a[x][y]=' ';
                    x++;
                    a[x][y]=p[r];
                }
                if(ch==119&&a[x-1][y]==' '||a[x][y-1]=='D')
                {
                    a[x][y]=' ';
                    x--;
                    a[x][y]=p[r];
                }
                system("cls");
                for(long long i=0;i<=oplen;i++)
			    {
			    	//cout< 

一共1200多行代码,看似很多,实际还行
不知不觉字数就两万五了。。。
完结

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/743465.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号