搜索
查看: 423|回复: 3

[原创] 无聊的文字游戏(都称不上是)v1.0测试

[复制链接]
 楼主| 发表于 2018-10-14 09:52:00 | 显示全部楼层 |阅读模式
做了个无聊的程序
代码:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
        char a[50][50]={"1.开始游戏",
                                        "2.退出游戏",
                    "3.作者介绍",
                   };
    int w,g,i,e,ws,gs;
    w=100;
    g=50;
    ws=4;
    gs=7;
    char ch,sh;
    for(i=0;i<=2;i++)
       puts(a[i]);
    ch=getch();
    if(ch=='2')
    {
                system("cls");
                printf("再见,\n我会想你的。\n");
        Sleep(5000);
    }
    if(ch=='3')
    {
                system("cls");
                printf("by 编程CCC\n做这个程序没什么意义\n");
        Sleep(10000);
    }
        if(ch=='1')
    {
                system("cls");
        printf("正在加载一次性打怪游戏\n(第一关)\n本游戏现在只有第一关\n");
        Sleep(20000);
        system("cls");
        printf("开始攻击!!!\n");
                g=g/ws;
                w=w/gs;
                printf("谁的血多谁胜利\n");
        Sleep("80000");
                printf("经历好长时间终于好了\n");
                printf("怪:\n%d\n我:\n%d\n",g,w);
                printf("你赢了");
                Sleep(20000);
    }
        return 0;
}

文字游戏(第一关)v1.0测试版.zip

9.7 KB, 下载次数: 4

不要做伸手党

 楼主| 发表于 2018-10-14 09:53:00 | 显示全部楼层
这个代码位置不太对   
 楼主| 发表于 2018-10-14 09:54:43 | 显示全部楼层
代码是这样的         
捕获.PNG
捕获2.PNG
发表于 2018-10-19 22:42:39 | 显示全部楼层
你好像打错了两个地方

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
        char a[50][50]={"1.开始游戏",
                                        "2.退出游戏",
                    "3.作者介绍",
                   };
    int w,g,i,e,ws,gs;
    w=100;
    g=50;
    ws=4;
    gs=7;
    char ch,sh;
    for(i=0;i<=2;i++)
       puts(a[i]);
    ch=getchar();
    if(ch=='2')
    {
                system("cls");
                printf("再见,\n我会想你的。\n");
        Sleep(5000);
    }
    if(ch=='3')
    {
                system("cls");
                printf("by 编程CCC\n做这个程序没什么意义\n");
        Sleep(10000);
    }
        if(ch=='1')
    {
                system("cls");
        printf("正在加载一次性打怪游戏\n(第一关)\n本游戏现在只有第一关\n");
        Sleep(20000);
        system("cls");
        printf("开始攻击!!!\n");
                g=g/ws;
                w=w/gs;
                printf("谁的血多谁胜利\n");
        Sleep(80000);
                printf("经历好长时间终于好了\n");
                printf("怪:\n%d\n我:\n%d\n",g,w);
                printf("你赢了");
                Sleep(20000);
    }
        return 0;
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表