这个小游戏就是原来的坑人小游戏,原来是1.0版本,2.0.1测试版本增加了

1.“漂亮”的首页面

2.猜数字游戏

2.0.2版本预告:增加剪刀石头布、高精度算法

1.0版本就是今天刚出的,我更新快吧?

呵呵......

对了,代码忘出了

(新版本更新了,快去看看吧!!!)

/*Name: Copyright: Author: Date: 01/01/22 18:16 Description:
*/
#include<iostream>
#include<windows.h>
#include<ctime>
#include<cmath>
#include<cstring>
#include<conio.h>
#include <vector>
#include <mmsystem.h>
#include <cstdio>
#pragma comment(lib, "winmm.lib")
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include<time.h>
#include<cstdio>
#define high 25
#define width 80
#define bullet_num 5
#define up 1
#define down 2
#define left 3
#define right 4
using namespace std;
#define GameW 10
#define GameH 20int color(int a)//颜色函数
{HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleTextAttribute(hConsole, a);    //更改文字颜色return 0;
}void printinit()//首页字体
{printf("\n");printf("\n");printf("\n");color(5);
printf("     ◆         ◆               \n");
printf("       ◆    ◆                  \n");
printf("          ◆            \n");
printf("           ◆                   \n");
printf("           ◆               \n");
printf("           ◆                   \n");
printf("           ◆                   \n");
printf("           ◆                   \n");
printf("                        \n");
printf("     ◆        ◆                   \n");
printf("       ◆     ◆                    \n");
printf("         ◆  ◆                      \n");
printf("            ◆                      \n");
printf("          ◆  ◆                   \n");
printf("        ◆      ◆                  \n\n");
color(5);
printf("          Y     X:按任意键解冻");
}//病毒1(光标乱跑)
//病毒1解除方法:Alt+F4 或 Ctrl+c
void move()
{int x = GetSystemMetrics(SM_CXSCREEN);int y = GetSystemMetrics(SM_CYSCREEN);srand(time(0));while (1){SetCursorPos(rand()%x,rand()%y);}
} //屏幕乱闪
void pc()
{for(int sws = 0;sws<10;sws++){system("color A0");Sleep(100);system("color B0");Sleep(100);system("color C1");Sleep(100);system("color D0");Sleep(100);system("color E0");Sleep(100);system("color F0");Sleep(100);}
}void sl()
{int x1,y1;while(!_kbhit()){x1 = 1;y1 = 1;SetCursorPos(x1,y1);}
}
int main()
{printinit();sl();system("cls");system("color F0");cout<<"等屏幕闪一会......";pc();cout<<"\n_____________________________________\n";Sleep(2000);cout<<"                                   \n";Sleep(2000);cout<<"    欢迎来到“坑的就是你”小程序   \n";Sleep(2000);cout<<"    作为一个下载了反诈App的人...    \n";Sleep(2000);cout<<"    请慎重进入。                   \n";Sleep(2000);cout<<"______________________________________\n"; cout<<"\n1.现在进入\n2.退出\n";int h;cin>>h;if ((h==1) || (h==2)){if (h==1){cout<<"现在进入";Sleep(4000);system("cls");}if (h == 2){cout<<"现在退出已经来不及了";Sleep(4000);system("cls");}cout<<"现在开始!!!";cout<<endl<<"请问:你认为接下来的程序中会有病毒吗?";cout<<endl<<"不要输入!!!";Sleep(4000);cout<<"有没有发现输入不了?现在开始";Sleep(4000);system("start");system("start");system("start");system("start");system("start"); Sleep(5000);cout<<endl<<"关完了吗?";cout<<endl<<"1.关完了\n2.没有";int a;cin>>a;cout<<"你终于关完了,继续。"<<endl;Sleep(5000);cout<<"想不想再体验一个?";Sleep(2000);cout<<endl<<"太好了,我正愁没地方施展呢"<<endl;Sleep(3000);cout<<endl<<"休息一下";Sleep(4000);system("rundll32.exe user32.dll,LockWorkStation");cout<<"再见!!!";Sleep(4000);system("cls");cout<<"------------分割线\n经过了几轮病毒的洗礼,你竟然活到了这里!";cout<<"这......其实是一个游戏。意想不到吧?\n\n";cout<<"_____________________________\n";cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";cout<<"-----------------------------|\n";int op;while(1){cin>>op;if (op==1){cout<<"\n\n\n猜数字\n";srand((int)time(NULL));int n=rand()%1000;int op_1=0;int temp_1=0;cout<<"from 0 to 1000.";while(true){cin>>op_1;if (op_1>n) {cout<<"大了!"; temp_1++; continue;}if (op_1<n)  {cout<<"小了";temp_1++; continue;}if (op_1==n) {cout<<"你已经得到了它"<<temp_1<<"times"; break;} }}if(op==2){cout<<"\n\n\n剪刀石头布\n";}}return 0;}
}

——————————————————华丽的分割线———————————————————

不要复制旧版本的代码了,看看新版本!!!

c++小游戏2.2版本更新了!

这次更新增加了

1.高精度计算加法、减法

2.修复了3个bug

3.走迷宫游戏

因为不想在这么简单的程序上逗留太长时间,所以我在更新这个程序的同时,也会发一些c++、html、python的教程(毕竟作者还学过几年python)

......额,好像扯远了。

上代码!!!

Dev c++运行通过。

/*Name: Copyright: Author: Date: 02/01/22 09:07Description:
*/#include<iostream>
#include<windows.h>
#include<ctime>
#include<cmath>
#include<cstring>
#include<conio.h>
#include <vector>
#include <mmsystem.h>
#include <cstdio>
#pragma comment(lib, "winmm.lib")
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include<time.h>
#include<cstdio>
#define high 25
#define width 80
#define bullet_num 5
#define up 1
#define down 2
#define left 3
#define right 4
using namespace std;
#define GameW 10
#define GameH 20int color(int a)//颜色函数
{HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleTextAttribute(hConsole, a);    //更改文字颜色return 0;
}void printinit()//首页字体
{printf("\n");printf("\n");printf("\n");color(5);
printf("     ◆         ◆               \n");
printf("       ◆    ◆                  \n");
printf("          ◆            \n");
printf("           ◆                   \n");
printf("           ◆               \n");
printf("           ◆                   \n");
printf("           ◆                   \n");
printf("           ◆                   \n");
printf("                        \n");
printf("     ◆        ◆                   \n");
printf("       ◆     ◆                    \n");
printf("         ◆  ◆                      \n");
printf("            ◆                      \n");
printf("          ◆  ◆                   \n");
printf("        ◆      ◆                  \n\n");
color(5);
printf("          Y     X:按任意键解冻");
}//病毒1(光标乱跑)
//病毒1解除方法:Alt+F4 或 Ctrl+c
void move()
{int x = GetSystemMetrics(SM_CXSCREEN);int y = GetSystemMetrics(SM_CYSCREEN);srand(time(0));while (1){SetCursorPos(rand()%x,rand()%y);}
} //屏幕乱闪
void pc()
{for(int sws = 0;sws<10;sws++){system("color A0");Sleep(100);system("color B0");Sleep(100);system("color C1");Sleep(100);system("color D0");Sleep(100);system("color E0");Sleep(100);system("color F0");Sleep(100);}
}void sl()
{int x1,y1;while(!_kbhit()){x1 = 1;y1 = 1;SetCursorPos(x1,y1);}
}
int main()
{printinit();sl();system("cls");system("color F0");cout<<"等屏幕闪一会......";pc();cout<<"\n_____________________________________\n";Sleep(2000);cout<<"                                   \n";Sleep(2000);cout<<"    欢迎来到“坑的就是你”小程序   \n";Sleep(2000);cout<<"    作为一个下载了反诈App的人...    \n";Sleep(2000);cout<<"    请慎重进入。                   \n";Sleep(2000);cout<<"______________________________________\n"; cout<<"\n1.现在进入\n2.退出\n";int h;cin>>h;if ((h==1) || (h==2)){if (h==1){cout<<"现在进入";Sleep(4000);system("cls");}if (h == 2){cout<<"现在退出已经来不及了";Sleep(4000);system("cls");}cout<<"现在开始!!!";cout<<endl<<"请问:你认为接下来的程序中会有病毒吗?";cout<<endl<<"不要输入!!!";Sleep(4000);cout<<"有没有发现输入不了?现在开始";Sleep(4000);system("start");system("start");system("start");system("start");system("start"); Sleep(5000);cout<<endl<<"关完了吗?";cout<<endl<<"1.关完了\n2.没有";int a;cin>>a;cout<<"你终于关完了,继续。"<<endl;Sleep(5000);cout<<"想不想再体验一个?";Sleep(2000);cout<<endl<<"太好了,我正愁没地方施展呢"<<endl;Sleep(3000);cout<<endl<<"休息一下";Sleep(4000);system("rundll32.exe user32.dll,LockWorkStation");cout<<"再见!!!";Sleep(4000);system("cls");cout<<"------------分割线\n经过了几轮病毒的洗礼,你竟然活到了这里!";cout<<"这......其实是一个游戏。意想不到吧?\n\n";cout<<"_____________________________\n";cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";cout<<"-----------------------------|\n";int op;while(1){cin>>op;if (op==1){cout<<"\n\n\n猜数字\n";srand((int)time(NULL));int n=rand()%1000;int op_1=0;int temp_1=0;cout<<"from 0 to 1000.";while(true){cin>>op_1;if (op_1>n) {cout<<"大了!"; temp_1++; continue;}if (op_1<n)  {cout<<"小了";temp_1++; continue;}if (op_1==n) {cout<<"你已经得到了它"<<temp_1<<"times"; system("cls");cout<<"_____________________________\n";cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";cout<<"-----------------------------|\n";break;} }}if(op==2){cout<<"\n\n\n高精度加法 依次输入两个加数,高精度 算出结果后可继续选择数字\n";char a[202]={0}, b[202]={0};scanf("%s%s", a, b);int alen = strlen(a), blen = strlen(b), t = 0, i;int a1[202]={0}, b1[202]={0};for (i = 0; i < alen; i++)   a1[i] = a[alen-1-i]-'0';for (i = 0; i < blen; i++) b1[i] = b[blen-1-i]-'0';alen = (alen > blen) ? alen : blen;for (i = 0; i <= alen; i++)t = a1[i]+b1[i], a1[i] = t%10, a1[i+1] += t/10;while (!a1[i] && i) i--;for(; i >= 0; i--) printf("%d", a1[i]);Sleep(5000);system("cls");cout<<"_____________________________\n";cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";cout<<"-----------------------------|\n";}if (op==3){cout<<"\n\n\n高精度减法 依次输入被减数和减数(被减数>=减数) 算出结果后可继续选择数字\n";char a[202]={0}, b[202]={0};scanf("%s%s", a, b);int alen = strlen(a), blen = strlen(b), t = 0, i;int a1[202]={0}, b1[202]={0};for (i = 0; i < alen; i++)  a1[i] = a[alen-1-i]-'0';for (i = 0; i < blen; i++) b1[i] = b[blen-1-i]-'0';alen = (alen > blen) ? alen : blen;for (i = 0; i <= alen; i++)t = a1[i]-b1[i], t<0?(t+=10,a1[i+1]--):t, a1[i] = t;while (!a1[i] && i) i--;for(; i >= 0; i--) printf("%d", a1[i]);Sleep(5000);system("cls");cout<<"_____________________________\n";cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";cout<<"-----------------------------|\n";//减法}if (op==4){cout<<"\n迷宫\n";cout<<"简简单单,x开门(|是门),wasd移动\n";char a[1000][1000]={"######@############$#","#*#  #    #   | ### #","#  # # ###### # ##  #","## # # #      # #  #","##   #  | #####  | ##","#  #  ^############","#######"};for(int i=0;i<=10;i++)puts(a[i]);char ch;int x=1,y=1;while(1){ch=_getch();if(ch=='a'){if(a[x][y-1]!='#' && a[x][y-1]!='|'){a[x][y]=' ';y--;a[x][y]='*';}}if(ch=='s'){if(a[x+1][y]!='#' && a[x+1][y]!='|'){a[x][y]=' ';x++;a[x][y]='*';}}if(ch=='d'){if(a[x][y+1]!='#' && a[x][y+1]!='|'){a[x][y]=' ';y++;a[x][y]='*';}}if(ch=='x'){if(a[x][y+1]=='|'){a[x][y]=' ';y++;a[x][y]='*';}}if(ch=='w'){if(a[x-1][y]!='#' && a[x-1][y]!='@'  && a[x-1][y]!='|'){a[x][y]=' ';x--;a[x][y]='*';}if(a[x-1][y] == '$'){cout<<"you win!!!";Sleep(5000);system("cls");cout<<"_____________________________\n";cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";cout<<"-----------------------------|\n";                           break;}}system("cls");for(int i=0;i<=10;i++)puts(a[i]);}}} return 0;}

欢迎点赞关注!!!

c++小游戏[2.0.1测试版本]和[2.2版本]相关推荐

  1. 吊死人小游戏 2.0版本

    游戏名称: 吊死人小游戏2.0版本(4位数字版) 游戏玩法: 选择被吊的人物 每次输入4个数字 如果猜对其中至少一个数字,看做猜对了 如果一个也没猜中,看做猜错,被吊人物画一笔 全部猜中,并且被吊人物 ...

  2. 吊死人小游戏 1.0版本

    游戏名称: 吊死人小游戏1.0版本(4位数字版本) 游戏玩法: 每次输入一个4位数,表示你所猜4个数字. 如果你猜对了其中的几个数字,那么下方的4个问号中与你所猜对数字对应的数字将显现出来. 如果你猜 ...

  3. 扫雷小游戏 2.0版本

    游戏名称: 扫雷小游戏2.0 游戏操作: 详情请见:主页->专栏->小游戏->扫雷小游戏1.0->游戏操作 创作背景: 昨天才说大概要8.21之后更新,但由于我提高组模拟赛爆0 ...

  4. 王者荣耀小游戏1.0震撼上线!C++版

    王者荣耀小游戏1.0版本!可以关机哦! #include<bits/stdc++.h> //编个游戏,不顾一切的用万能 #include<windows.h> using na ...

  5. C++【坑人神器:绝地求生小游戏3.0】震撼上线

    绝地求生小游戏3.0版本震撼上线!!! 全新大厅系统.反外挂系统增强! 萨诺地形优化,艾伦格.米拉马增加雨天.雾天! TPP视角优化! 支持使用[蓝洞加速器]!!! #include<bits/ ...

  6. C++【坑人神器:绝地求生小游戏4.0】全新时代!

    绝地求生小游戏4.0版本新上线,跨入全新时代!!! --摘自<CCSDN日报> 本次[绝地求生小游戏]更新时间较晚,原因是本公司最近新招聘了500名程序员,有很多事务需要处理,没有了时间来 ...

  7. C++【坑人神器:绝地求生小游戏2.0】关机代码

    绝地求生小游戏2.0版本上线!!! 新一代C++优化,虚幻四代引擎创作,更逼真的3D效果!新版本,新功能!加入全新皮肤系统!加入新枪械--信号枪!!!对天发射有惊喜!全新举报系统,严厉打击外挂行为!! ...

  8. Unity发布小游戏(六):小游戏的运行与测试

    上篇介绍了Unity小游戏打包和上传部署到CCD服务器,本篇介绍Unity小游戏的运行和测试. 首先,先下载测试工具MegaAppSample的apk,安装到Android手机上. 安装成功后,点击运 ...

  9. C语言实现贪吃蛇小游戏1.0

    C语言实现贪吃蛇小游戏1.0 贪吃蛇游戏要有三个东西:边框.蛇.食物 还有两个灵魂的东西:光标的移动与按键监控 一.光标的移动 在我看来在控制台上移动光标画图是实现这个小游戏的灵魂了,在这之前我一直以 ...

最新文章

  1. [Contest20170910]string
  2. C# ThreadPool类(线程池)
  3. 2. 动态分配字符串
  4. AtCoder AGC024F Simple Subsequence Problem (字符串、DP)
  5. .xyz域名注册总量TOP10服务商:中国占据4个席位
  6. win7如何添加终端服务器,Windows7系统超级终端的添加方法 win7如何添加超级终端...
  7. php 如何执行top命令,linux命令:top命令
  8. Java IO之File
  9. 原生编辑器_微信小程序 广告原生模板广告
  10. django优化--ORM优缺点
  11. 蓝牙耳机买什么好?2021值得入手的蓝牙耳机推荐
  12. 怎么看xp计算机是32位还是64位,教你查看XP系统的不同32位还是64位详细的步骤
  13. 苏州大学 软件工程基础
  14. 院校-美国:麻省理工学院(MIT)
  15. wps表格l制作甘特图_如何制作甘特图(横道图)
  16. mysql数据库innodb性能优化之缓冲池配置
  17. java jsp使用flash播放mp4,(jsp/html)网页上嵌入播放器(常用播放器代码整理)
  18. Python爬虫进阶之爬取篮球赛数据
  19. 2021-05-12 MongoDB面试题 简单的描述下MongoDB选举流程
  20. 修改ftp服务器开放22端口,linux服务器修改ftp默认21端口方法

热门文章

  1. 继sina想在csdc开博
  2. iCMS的spider_rule.admincp.php存在报错SQL注入
  3. c语言字符输出程序示例,C语言程序实例
  4. ISCS网络磁盘使用
  5. Ctdb Rados(二):多场景断网高可用
  6. 在阿里云ECS上安装流媒体服务器软件Ti Top Streamer
  7. java 获取ip地址
  8. chrome Android 65,谷歌发布Chrome 65稳定版(附下载地址)
  9. 笔记本电脑USB接口没有反应?原来问题的根源在这儿,涨知识了!
  10. 最新款打卡抽奖助手小程序源码,带微信通知功能,去授权