本文主要是介绍C++游戏(自创)(新),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这个可能是一个你不太会玩的游戏。
看到上面这句话别担心,请勿着急复制代码!!!!(代码在最下面)
如果您还在下滑查看代码的话,就别怪我没提醒你了。
咳咳,好了,接下来该说游戏规则了。
Part 1 游戏规则
首先,我要声明一下,游戏原型基本都是《最强大脑之燃烧吧大脑第十一季》中选手挑战的比赛,所以同样可以当作小游戏使用。
需要注意的是,这个cpp带有自动保存功能,既你在其中获得的任何奖励,都可以在下次打开时不丢失(但如果你删除了xc.in文件就没得说了)。
当你打开的时候,你会发现有序号 1~12,现在请让我详细的解释每个序号的规则。
序号 1 (数列叠加)【计算力】
你一进去会看到:哇,这个作者脑子有包欸!搞了这么多数列。
其实所有数列个数都是随机的, 你需要构造一种叠加方案,让其中的 组数列所有数字叠加之后得到的数列所有数字相等。
你需要先输入这个 ,然后输入你认为叠加的数列编号。
无论正确和错误都会有反馈,每做完一道题,你都可以选择继续或退出。(这个游戏没有奖励)
序号 2 (速算秘境)【计算力】
按游戏中的文字提示输入自己想去计算的形式,有奖励。
但是如果你没有学过珠心算,这个游戏可能难度加倍不止一点!
序号 3 (记忆矩阵)【记忆力】
按游戏中的文字提示输入自己想去记忆的形式,有奖励。
每弹出一个矩阵,你都要将其中带颜色的部分迭代,即 有+有=无,有+无=有,无+无=无
最后输出迭代之后的矩阵。
序号 4 (大数乘除)【计算力】
按游戏中的文字提示输入自己想去计算的形式,有奖励。
但是如果你没有学过珠心算,这个游戏可能难度加倍不止一点!
序号 5 (时针逆转)【推理力】【创造力】【记忆力】
按提示输入自己想要的盘面(新手建议7*7的盘面,3个)。
逆转的规则:若在 (x,y) 位置逆转,则 (x-1,y-1) 到 (x+1,y+1) 九个格子旋转 180°,再向外扩大一圈的 16 个格子顺时针旋转 45°,最终要使所有指针向上(绿色),有奖励,有解析。
序号 6 (植此青绿)【推理力】【创造力】【记忆力】【观察力】
J 代表此处的叠加个数为奇数个,O 代表此处的叠加个数为偶数个,当叠加次数 >= 4 时,会显示数字。
现在你需要操作你的盘面,放置叠加方块,使得满足要求盘面的叠加数量,有解析,有提示,有奖励。
序号 7 (碎片记忆)【记忆力】
记住盘面,倒计时之后会给你一个片段,你需要回忆起它存在于哪个盘面里!!!有奖励。
序号 8 (幸运转盘)
可娱乐。
序号 9 (递增转盘)
可娱乐。
序号 10 (仓库)
可查看奖品。
序号 11 (自动刷卡器)
可先后输入【我不知道】【抢劫】或【123456】【对】【不信】进入。
序号 12 (新春集福)
同抖音、头条、百度等平台。
Part 2 通关要求
简单!10 个殿堂钻石。
Part 3 结束语
你肯定等不及了吧,好,代码来了!
我不求您们一定要点赞/关注/评论什么的,只要您玩的开心,就足够了!
#include <bits/stdc++.h>
#include <windows.h>
#define int long long
using namespace std;
int LNG, NIAN, DA, JI, WAN, JIA, XIN, XI, LE, HUAN, XIAO, YU, guan, zeng, bi, zhuan, zuan, dian, cang[110];
int a[110][110][110];
int sum[110][110];
void Read() {ifstream in("xc.in");in>>LNG>>NIAN>>DA>>JI>>WAN>>JIA>>XIN>>XI>>LE>>HUAN>>XIAO>>YU>>guan>>zeng>>bi>>zhuan>>zuan>>dian;for (int i = 1; i <= 100; i++) in>>cang[i];in.close();
}
void Save() {ofstream out("xc.in");out<< ' ' <<LNG<< ' ' <<NIAN<< ' ' <<DA<< ' ' <<JI<< ' ' <<WAN<< ' ' <<JIA<< ' ' <<XIN<< ' ' <<XI<< ' ' <<LE<< ' ' <<HUAN<< ' ' <<XIAO<< ' ' <<YU<< ' ' <<guan<< ' ' <<zeng<< ' ' <<bi<< ' ' <<zhuan<< ' ' <<zuan<< ' ' <<dian << endl;for (int i = 1; i <= 100; i++) out<<cang[i]<<' ';out<<'\n';out.close();
}
void gam1 () {printf("选择你认为的叠加次数和 Part 部分进行叠加,使得最后整个矩阵相等");printf("\nWait 10s...(如果过程中突然结束运行为正常现象,可以再度打开)");Sleep(10000);srand(time(NULL));while (1) {system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;}printf("加载中...(这里可能最短需要1s,最长需要1min~2min)\n");guan++;int l = rand() % 5 + guan, r = rand() % 10 + guan;while (l > r) l = 2 + rand() % 3 + guan, r = 5 + rand() % 5 + guan;int now = rand() % (r - l) + l + 1;while (now < 5) now = rand() % (r - l) + l + 1;int bian = rand() % 3 + 3 + guan;int die = rand() % guan + 2;for (int no = 1; no <= die; no++) {for (int i = 1; i <= bian; i++) {for (int j = 1; j <= bian; j++) {sum[i][j] = now;}}for (int l = 1; l < die; l++) {for (int i = 1; i <= bian; i++) {for (int j = 1; j <= bian; j++) {int kou = rand() % now;while((sum[i][j] - kou) < (die - 1)) {kou = rand() % now;
// cout << 1;}sum[i][j] -= kou;a[(no - 1) * die + l][i][j] = kou;}}}for (int i = 1; i <= bian; i++) {for (int j = 1; j <= bian; j++) {a[(no - 1) * die + die][i][j] = sum[i][j];}}}system("cls");int xian = 0;int vis[1100], right[1100], tot = 0;memset(vis, 0, sizeof(vis));for (int no = 1; no <= die; no++) {int rad = rand() % 5 + 1;for (int i = 0; i < rad; i++) {int get = die + rand() % die + 1;if (!vis[get]) {
// vis[get] = 1;printf("Part %lld:\n", ++ xian);for (int i = 1; i <= bian; i++) {for (int j = 1; j <= bian; j++) {int iabia = rand() % now;if (iabia < (now / 3))printf("%3lld ",max(a[get][i][j] - iabia, rand()%now));elseprintf("%3lld ",max(a[get][i][j] + iabia, rand()%now));}printf("\n");}printf("\n");}}printf("Part %lld:\n", ++ xian);right[++tot] = xian;for (int i = 1; i <= bian; i++) {for (int j = 1; j <= bian; j++) {printf("%3lld ", a[no][i][j]);}printf("\n");}printf("\n");}printf("\n请输入叠加次数: ");int cc;
a1:cin>>cc;if (cc != die) {system("Color C");printf("回答错误\n");Sleep(1000);system("Color F");printf("请再次输入: ");goto a1;}printf("请按顺序输入你觉得正确的编号(如:1 3 5): ");int ans[1100];
a2:for (int i = 1; i <= die; i++) {cin >> ans[i];}int flag = 1;vector<int> aa;aa.clear();for (int i = 1; i <= die; i++) {if (ans[i] != right[i]) {flag = 0;} else {aa.push_back(ans[i]);}}if (flag == 1) {system("cls");printf("回答正确,即将跳转下一题(等待10s)\n");bi += die * 1000;zhuan += die * 100;zuan += die * 10;Sleep(10000);} else {system("Color C");printf("回答错误\n");if (aa.size()) printf("正确 Part 有: ");else printf("暂无正确 Part");for (int i = 0; i < (int)aa.size(); i++) {cout << aa[i] << ' ';}printf("\n");Sleep(1000);system("Color F");printf("请再次输入: ");goto a2;}}
}
void HideCursor(bool Visible) {CONSOLE_CURSOR_INFO Cursor;Cursor.bVisible = !Visible;Cursor.dwSize = sizeof(Cursor);HANDLE Hand = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorInfo(Hand, &Cursor);
}
void gam2() {while (1) {srand(time(NULL));system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;}printf("请输入运算位数(1<=x<=10): ");int a;cin>> a;
// printf("请输入乘除选项(0<=x<=1)(0为乘,1为除): ");
// int b; cin >> b;printf("请输入数字个数(1<=x<=500): ");int c;cin >> c;printf("请输入间隔时常(ms)(1000ms=1s)(200<=x<=5000): ");int d;cin >> d;printf("请输入计算个数(脑数)(1<=x<=3): ");int e;cin >> e;printf("接下来,看向屏幕左上角,准备接受 3 2 1 的倒计时(Wait 3s)\n");Sleep(3000);system("cls");int sum1 = 0, sum2 = 0, sum3 = 0;printf("3");if (e > 1) printf(" | 3");if (e > 2) printf(" | 3");Sleep(1000);system("cls");printf("2");if (e > 1) printf(" | 2");if (e > 2) printf(" | 2");Sleep(1000);system("cls");printf("1");if (e > 1) printf(" | 1");if (e > 2) printf(" | 1");Sleep(1000);system("cls");printf("GO!");if (e > 1) printf(" | GO!");if (e > 2) printf(" | GO!");Sleep(1000);system("cls");for (int i = 1; i <= c; i++) {system("cls");int now = 0;for (int j = 1; j <= a; j++) {int st = rand() % 10;if (j == 1 && st == 0) st = rand() % 9 + 1;now = now * 10 + st;}int check = rand() % 5;if (check == 0) now = -now;printf("%lld", now);sum1 += now;if (e > 1) {printf(" | ");now = 0;for (int j = 1; j <= a; j++) {int st = rand() % 10;if (j == 1 && st == 0) st = rand() % 9 + 1;now = now * 10 + st;}check = rand() % 5;if (check == 0) now = -now;printf("%lld", now);sum2 += now;}if (e > 2) {printf(" | ");now = 0;for (int j = 1; j <= a; j++) {int st = rand() % 10;if (j == 1 && st == 0) st = rand() % 9 + 1;now = now * 10 + st;}check = rand() % 5;if (check == 0) now = -now;printf("%lld", now);sum3 += now;}Sleep(d-50);system("cls");Sleep(50);}system("cls");printf("请作答");if (e > 1) printf(" | 请作答");if (e > 2) printf(" | 请作答");printf("\n");int nn[5];for (int i = 0; i < e; i++) {cin>>nn [i];}if (nn[0] == sum1) {printf("第一脑回答正确\n");bi += sum1 * 100;zhuan += sum1 * 10;zuan += sum1;} else printf("第一脑回答错误 正确答案为 %lld\n", sum1);if (e > 1 && nn[1] == sum2) {printf("第二脑回答正确\n");bi += sum2 * 100;zhuan += sum2 * 10;zuan += sum2;} else if (e > 1) printf("第二脑回答错误 正确答案为 %lld\n", sum2);if (e > 2 && nn[2] == sum3) {printf("第三脑回答正确\n");bi += sum3 * 100;zhuan += sum3 * 10;zuan += sum3;} else if (e > 2) printf("第三脑回答错误 正确答案为 %lld\n", sum3);printf("等待 10s 跳转下一循环\n");Sleep(10000);}
}
void gam3() {while (1) {srand(time(NULL));
// HideCursor(1);system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;}printf("请输入边长(3<=x<=100)");int a;cin>> a;printf("请输入矩阵个数(1<=n<=50): ");int b;cin >> b;printf("请输入间隔时常(ms)(1000ms=1s)(200<=x<=5000): ");int c;cin >> c;printf("请输入每个矩阵的灯数(1<=x<=n^2-1): ");int d;cin >> d; printf("接下来,看向屏幕左上角,准备接受 3 2 1 的倒计时(Wait 3s)\n");Sleep(3000);system("cls");printf("3");Sleep(1000);system("cls");printf("2");Sleep(1000);system("cls");printf("1");Sleep(1000);system("cls");printf("GO!");Sleep(1000);system("cls");int map[110][110];int ans[110][110];int now[110][110];for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {ans[i][j] = 0;now[i][j] = 0;}}for (int i = 1; i <= b; i++) {for (int j = 1; j <= a; j++) {for (int k = 1; k <= a; k++) {map[j][k] = 0;}}for (int j = 1; j <= d; j++) {int xx = rand() % a + 1, yy = rand() % a + 1;while (map[xx][yy]) xx = rand() % a + 1, yy = rand() % a + 1;map[xx][yy] = 1;}for (int j = 1; j <= a; j++) {for (int k = 1; k <= a; k++) {ans[j][k] = (ans[j][k] + map[j][k]) % 2;if (map[j][k]) cout << "■ ";else cout << "□ ";}cout << endl;}Sleep(c - 50);system("cls");Sleep(50);}
stt:system("cls");printf("请作答\n\n你现在的作答盘面长这个样子:\n\n");Sleep(20);for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {if (now[i][j]) cout << "■ ";else cout << "□ ";}Sleep(20);cout << endl;}Sleep(20);printf("\n如果你想要改变方块的点数,请输入x y(均为1开始),如果你想提交答案,请输入0 0\n\nChange to: ");int ansx, ansy;cin >> ansx >> ansy;if (ansx && ansy) {now[ansx][ansy] = (now[ansx][ansy]+1)%2;goto stt;}int aha = 0;int flag = 1, heihei = 0;for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {if (now[i][j] != ans[i][j]) {flag = -1;heihei--;} else if (now[i][j] == 1) heihei++;if (now[i][j] == ans[i][j] && ans[i][j] == 1) aha++;}}if (flag == -1) {system("color C");printf("回答错误\n");Sleep(200);printf("正确灯点为:\n");int tr = 0; for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {if (ans[i][j]) cout << "■ ";else cout << "□ ";if (ans[i][j]) tr++;}Sleep(200);cout << endl;}Sleep(200);printf("\n你的正确率为%.2lf%%\n", 100 * (1.0 * max(heihei, 0LL)) / (1.0 * tr));Sleep(200);system("color F");} else {printf("回答正确\n\n");bi += aha * 100;zhuan += aha * 10;zuan += aha;printf("即将前往下一循环\n");}printf("(等待10s)");Sleep(10000);}
}
void gam4() {while (1) {srand(time(NULL));system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;}printf("请输入数字位数(1<=x<=10): ");int a;cin>> a;printf("请输入乘法除法(0=乘法,1=除法)(0<=n<=1): ");int b;cin >> b;printf("请输入计算时间(ms)(1000ms=1s)(200<=x<=60000): ");int c;cin >> c;printf("接下来,看向屏幕左上角,准备接受 3 2 1 的倒计时(Wait 3s)\n");Sleep(3000);system("cls");printf("3");Sleep(1000);system("cls");printf("2");Sleep(1000);system("cls");printf("1");Sleep(1000);system("cls");printf("GO!");Sleep(1000);system("cls");if (b == 0) {int sum1 = rand() % 9 + 1, sum2 = rand() % 9 + 1;for (int i = 1; i < a; i++) {sum1 = sum1 * 10 + rand() % 10;sum2 = sum2 * 10 + rand() % 10;}int ans = sum1 * sum2;printf("%lld * %lld", sum1, sum2);Sleep(c);system("cls");printf("请作答\n");int anss;scanf("%lld", &anss);if (anss != ans) {system("color C");printf("回答错误\n");Sleep(1000);system("color F");printf("\n正确答案为 %lld", ans);} else {printf("回答正确\n");bi += anss;zhuan += anss / 10;zuan += anss / 100;}} else {int sum1 = rand() % 9 + 1;for (int i = 1; i < a; i++) {sum1 = sum1 * 10 + rand() % 10;}vector<int> now;now.clear();for (int i = 1; i <= sum1; i++) {if (sum1 % i == 0) {now.push_back(i);}}int randd = rand() % now.size();printf("%lld / %lld", sum1, now[randd]);int ans = sum1 / now[randd];Sleep(c);system("cls");printf("请作答\n");int aha;scanf("%lld", &aha);if (aha != ans) {system("color C");printf("回答错误\n");Sleep(1000);system("color F");printf("\n正确答案为 %lld", ans);} else {printf("回答正确\n");bi += aha;zhuan += aha / 10;zuan += aha / 100;}}printf("\n\n(等待10s)");Sleep(10000);}
}
//1~100000
pair<string, int> jiangli[1100] = {{"[Nope]暂无奖品 谢谢光临", 83384}, //83.384%{"[Common]银币礼包[1]", 83384+5000}, //5%{"[Common]银币礼包[2]", 83384+5000+3000}, //3%{"[Unusual]银币礼包[3]", 83384+5000+3000+1000}, //1%{"[Common]金砖礼包[1]", 83384+5000+3000+1000+3000}, //3%{"[Unusual]金砖礼包[2]", 83384+5000+3000+1000+3000+1000}, //1%{"[Unusual]金砖礼包[3]", 83384+5000+3000+1000+3000+1000+1000}, //1%{"[Unusual]钻石礼包[1]", 83384+5000+3000+1000+3000+1000+1000+1000}, //1%{"[Rare]钻石礼包[2]", 83384+5000+3000+1000+3000+1000+1000+1000+500}, //0.5%{"[Rare]钻石礼包[3]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500}, //0.5%{"[Epic]追加礼包[1]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300}, //0.3%{"[Epic]追加礼包[2]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100}, //0.1%{"[Legendary]追加礼包[3]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70}, //0.07%{"[Legendary]全套礼包[1]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70+60}, //0.06%{"[Mythic]全套礼包[2]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70+60+40}, //0.04%{"[Mythic]全套礼包[3]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70+60+40+30}, //0.03%{"[Ultra]殿堂礼包[1]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70+60+40+30+10}, //0.01%{"[Ultra]殿堂礼包[2]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70+60+40+30+10+5}, //0.005%{"[Super]殿堂钻石[1]", 83384+5000+3000+1000+3000+1000+1000+1000+500+500+300+100+70+60+40+30+10+5+1}, //0.001%
};
void xin5() {
youshi:system("cls");srand(time(NULL));printf("递增转盘 银币数量: %lld 金砖数量: %lld 钻石数量: %lld 殿堂钻石: %lld\n", bi, zhuan, zuan, dian);printf("\n\n0.用 20000 银币进行抽奖\n1.用 2000 银币进行抽奖\n2.查看概率\n3.返回\n\n请选择: ");int ccc;cin>>ccc;if (ccc == 2) {for (int i = 0; i < 19; i++) {cout << jiangli[i].first << " ";if (i) printf("%.3lf%%", (1.0 * jiangli[i].second - jiangli[i - 1].second) / (1000.0));else printf("%.3lf%%", (1.0 * jiangli[i].second) / (1000.0));cout << endl;}printf("等待10s");Sleep(10000);} else if (ccc == 3) {return ;} else if (ccc == 1 && bi >= 2000) {bi -= 2000;printf("\n抽奖中...\n");Sleep(3000);int jig = rand() * rand() % 100000 + 1;for (int i = 0; i < 19; i++) {
// cout << jig << ' ' << jiangli[i].second << endl;if (jig <= jiangli[i].second) {cout << "本轮为 " << jiangli[i].first << endl;cang[i]++;break;}}Sleep(3000);} else if (ccc == 0 && bi >= 20000) {bi -= 20000;printf("\n抽奖中...\n");Sleep(3000);int ttt = 10;while (ttt--) {int jig = rand() * rand() % 100000 + 1;for (int i = 0; i < 19; i++) {if (jig <= jiangli[i].second) {cout << "本轮为 " << jiangli[i].first << endl;cang[i]++;break;}}}Sleep(3000);}goto youshi;
}
void xin6() {
youshi:system("cls");srand(time(NULL));printf("递增转盘 银币数量: %lld 金砖数量: %lld 钻石数量: %lld 殿堂钻石: %lld\n", bi, zhuan, zuan, dian);printf("程度(length): ");for (int i = 1; i <= 10; i++) {if (zeng >= i) {printf("■");} else {printf("□");}}printf("\n\n0.用 2000 金砖进行追加\n1.用 200 金砖进行追加\n2. 领取当前奖励(概率)\n3.返回\n\n请选择: ");int ccc;cin>>ccc;if (ccc == 2 && zeng) {int yb = 0, jz = 0, zs = 0, dz = 0;yb = (rand() % 100 + 1000) * zeng;jz = (rand() % 100 + 100) * zeng;zs = (rand() % 500 + 10) * zeng;if (zeng >= 4) {yb *= zeng;jz *= zeng;zs *= zeng;int ttt = rand() % 123;if (ttt <= 2) dz++;}int check = rand() % 80;if (zeng > 5 && check == 29) dz++;if (zeng >= 8 && check >= 60) dz += 2;if (zeng == 10 && check > 40) dz += 3;printf("当前奖励为: 银币+%lld 金砖+%lld 钻石+%lld 殿堂钻石+%lld\n\n为你发放至账户,欢迎下次光临(Wait 5s)", yb, jz, zs, dz);bi += yb, zhuan += jz, zuan += zs, dian += dz;Sleep(5000);zeng = 0;goto youshi;} else if (ccc == 1 && zhuan >= 200) {zhuan -= 200;printf("追加中...\n\n");Sleep(3000);int t = rand() % (zeng + 2);if (t < 2) {int shu = rand() % 10;if (shu < 8) {printf("追加成功 1 长度!\n");zeng++;} else if (shu == 8) {printf("追加成功 2 长度!\n");zeng+=2;} else if (shu == 9) {printf("追加成功 3 长度!\n");zeng+=3;}} else {int shu = rand() % 10;if (shu < 9) {printf("追加失败\n扣除 1 长度\n");zeng--;} else if (shu == 9) {printf("追加失败\n扣除 2 长度\n");zeng -= 2;}zeng = max(zeng, 0LL);}printf("等待 5s");Sleep(5000);goto youshi;} else if (ccc == 0 && zhuan >= 2000) {zhuan -= 2000;int sum = 10;while (sum--) {int t = rand() % (zeng + 2);if (t < 2) {int shu = rand() % 10;if (shu < 8) {printf("追加成功 1 长度!\n");zeng++;} else if (shu == 8) {printf("追加成功 2 长度!\n");zeng+=2;} else if (shu == 9) {printf("追加成功 3 长度!\n");zeng+=3;}} else {int shu = rand() % 10;if (shu < 9) {printf("追加失败 扣除 1 长度\n");zeng--;} else if (shu == 9) {printf("追加失败 扣除 2 长度\n");zeng -= 2;}zeng = max(zeng, 0LL);}}Sleep(5000);goto youshi;} else if (ccc == 3) return;goto youshi;
}
void xin7() {system("cls");printf("你的仓库里有: \n\n");int now = 1, tnow = 0;for (int i = 1; i < 19; i++) {if (cang[i]) {cout << now++ << ": " << jiangli[i].first << " * " << cang[i] << endl;}}printf("\n如果要使用请输入编号,否则输入 0\n");int bian;cin >> bian;if (bian >= now) return ;if (bian) {int id = -1;for (int i = 1; i < 19; i++) {if (cang[i]) {tnow++;if (tnow == bian) {id = i;cang[i]--;break;}}}int jia;srand(time(NULL));if (id == 1) {jia = 5000 + rand() % 10000;printf("Congratulations! 银币 + %lld", jia);bi += jia;} else if (id == 2) {jia = 10000 + rand() % 10000;printf("Congratulations! 银币 + %lld", jia);bi += jia;} else if (id == 3) {jia = 20000 + rand() % 10000;printf("Congratulations! 银币 + %lld", jia);bi += jia;} else if (id == 4) {jia = 5000 + rand() % 10000;printf("Congratulations! 金砖 + %lld", jia);zhuan += jia;} else if (id == 5) {jia = 10000 + rand() % 10000;printf("Congratulations! 金砖 + %lld", jia);zhuan += jia;} else if (id == 6) {jia = 20000 + rand() % 10000;printf("Congratulations! 金砖 + %lld", jia);zhuan += jia;} else if (id == 7) {jia = 5000 + rand() % 10000;printf("Congratulations! 钻石 + %lld", jia);zuan += jia;} else if (id == 8) {jia = 10000 + rand() % 10000;printf("Congratulations! 钻石 + %lld", jia);zuan += jia;} else if (id == 9) {jia = 20000 + rand() % 10000;printf("Congratulations! 钻石 + %lld", jia);zuan += jia;} else if (id == 10) {jia = 5000 + rand() % 10000;printf("Congratulations! 银币/金砖 + %lld", jia);bi += jia;zhuan += jia;} else if (id == 11) {jia = 10000 + rand() % 10000;printf("Congratulations! 银币/钻石 + %lld", jia);bi += jia;zuan += jia;} else if (id == 12) {jia = 20000 + rand() % 10000;printf("Congratulations! 金砖/钻石 + %lld", jia);zhuan += jia;zuan += jia;} else if (id == 13) {jia = 5000 + rand() % 10000;printf("Congratulations! 银币/金砖/钻石 + %lld", jia);bi += jia;zhuan += jia;zuan += jia;} else if (id == 14) {jia = 10000 + rand() % 10000;printf("Congratulations! 银币/金砖/钻石 + %lld", jia);bi += jia;zhuan += jia;zuan += jia;} else if (id == 15) {jia = 20000 + rand() % 10000;printf("Congratulations! 银币/金砖/钻石 + %lld", jia);bi += jia;zhuan += jia;zuan += jia;} else if (id == 16) {jia = 30000 + rand() % 10000;int jia2 = rand() % 2;printf("Congratulations! 银币/金砖/钻石 + %lld, 殿堂钻石 + %lld", jia, jia2);bi += jia;zhuan += jia;zuan += jia;dian += jia2;} else if (id == 17) {jia = 50000 + rand() % 10000;int jia2 = rand() % 3;printf("Congratulations! 银币/金砖/钻石 + %lld, 殿堂钻石 + %lld", jia, jia2);bi += jia;zhuan += jia;zuan += jia;dian += jia2;} else if (id == 18) {jia = 50000 + rand() % 10000;int jia2 = rand() % 10 + 5;printf("Congratulations! 钻石 + %lld, 殿堂钻石 + %lld", jia * jia, jia2);zuan += jia * jia;dian += jia2;}printf("\n\n");Sleep(5000);}
}
void color(int ForgC, int BackC) {WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
}
//1蓝 2绿 3淡蓝 4红 5粉 6土黄 7白 8灰
void gam5() {while (1) {srand(time(NULL));system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;}printf("请输入边长(1<=x<=100): ");int a;cin >> a;printf("请输入次数(1<=x<=100): ");int b;cin >> b;printf("接下来,看向屏幕左上角,准备接受 3 2 1 的倒计时(Wait 3s)\n");Sleep(3000);system("cls");printf("3");Sleep(1000);system("cls");printf("2");Sleep(1000);system("cls");printf("1");Sleep(1000);system("cls");printf("GO!");Sleep(1000);system("cls");//→←↑↓int vis[101][101], now[101][101];pair <int, int> jian[101];for(int i = 1; i <= a; i++)for(int j = 1; j <= a; j++) vis[i][j] = 0;for(int i = 1; i <= a; i++)for(int j = 1; j <= a; j++) now[i][j] = 0;for(int i = 1; i <= a; i++) jian[i].first = 0, jian[i].second = 0;for (int i = 1; i <= b; i++) {int sx = 1 + rand() % a, sy = 1 + rand() % a;while (vis[sx][sy]) sx = 1 + rand() % a, sy = 1 + rand() % a;jian[i].first = sx, jian[i].second = sy;vis[sx][sy] = 1;now[sx - 1][sy - 1] += 2;now[sx - 1][sy] += 2;now[sx - 1][sy + 1] += 2;now[sx][sy - 1] += 2;now[sx][sy] += 2;now[sx][sy + 1] += 2;now[sx + 1][sy - 1] += 2;now[sx + 1][sy] += 2;now[sx + 1][sy + 1] += 2;now[sx - 2][sy - 2]++;now[sx - 2][sy - 1]++;now[sx - 2][sy]++;now[sx - 2][sy + 1]++;now[sx - 2][sy + 2]++;now[sx - 1][sy - 2]++;now[sx - 1][sy + 2]++;now[sx][sy - 2]++;now[sx][sy + 2]++;now[sx + 1][sy - 2]++;now[sx + 1][sy + 2]++;now[sx + 2][sy - 2]++;now[sx + 2][sy - 1]++;now[sx + 2][sy]++;now[sx + 2][sy + 1]++;now[sx + 2][sy + 2]++;}int chong[110][110];for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {chong[i][j] = now[i][j];}}int ge = 0, check = 0;
zai:system("cls");int flag = 0;for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {if (now[i][j] != 0) flag = 1;now[i][j] += 400;now[i][j] %= 4;if (now[i][j] == 0) color(2, 0);if (now[i][j] == 0) printf("↑");if (now[i][j] == 1) color(8, 0);if (now[i][j] == 1) printf("←");if (now[i][j] == 2) color(4, 0);if (now[i][j] == 2) printf("↓");if (now[i][j] == 3) color(8, 0);if (now[i][j] == 3) printf("→");color(7, 0);printf(" ");}printf("\n");}if (flag == 0 && check == 0) {printf("作答正确 (Wait for 10s)\n");Sleep(10000);bi += a * a * 100 * b;zuan += a * a * b;zhuan += a * a * 10 * b;return ;}if (ge == b) {ge = 0;check = 0;printf("示范结束\n");Sleep(5000);for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {now[i][j] = chong[i][j];}}goto zai;}if (check == 0) printf("\n请输入改变的编号(0,0退出;-1,-1重置;-2,-2查看答案): ");int sx, sy;if (check) ge++;if (check == 0) cin >> sx >> sy;else sx = jian[ge].first, sy = jian[ge].second;if (check) printf("第 %lld 步, 坐标为 (%lld,%lld)\n", ge, sx, sy);if (check) Sleep(3000);if (sx == 0 && sy == 0) return ;if (sx == -1 && sy == -1) {for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {now[i][j] = chong[i][j];}}goto zai;}if (sx == -2 && sy == -2) {printf("准备中...");Sleep(3000);for (int i = 1; i <= a; i++) {for (int j = 1; j <= a; j++) {now[i][j] = chong[i][j];}}check = 1;goto zai;}now[sx - 1][sy - 1] -= 2;now[sx - 1][sy] -= 2;now[sx - 1][sy + 1] -= 2;now[sx][sy - 1] -= 2;now[sx][sy] -= 2;now[sx][sy + 1] -= 2;now[sx + 1][sy - 1] -= 2;now[sx + 1][sy] -= 2;now[sx + 1][sy + 1] -= 2;now[sx - 2][sy - 2]--;now[sx - 2][sy - 1]--;now[sx - 2][sy]--;now[sx - 2][sy + 1]--;now[sx - 2][sy + 2]--;now[sx - 1][sy - 2]--;now[sx - 1][sy + 2]--;now[sx][sy - 2]--;now[sx][sy + 2]--;now[sx + 1][sy - 2]--;now[sx + 1][sy + 2]--;now[sx + 2][sy - 2]--;now[sx + 2][sy - 1]--;now[sx + 2][sy]--;now[sx + 2][sy + 1]--;now[sx + 2][sy + 2]--;goto zai;}
}
VOID SetPosC(COORD a) { // set cursorHANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(out, a);
}
VOID SetPos(int x, int y) { // set cursor2COORD pos= {x, y};SetPosC(pos);
}
void slowsay(string s) {for (int i = 0; s[i]; i++) {cout << s[i];Sleep(10);}
}
void Slowsay(string s) {for (int i = 0; s[i]; i++) {cout << s[i];int ttt;for (int i = 1; i <= 1000000; i++)ttt++;}
}
void Start() {//▓■□srand(time(NULL));color(rand()%8+1,0);SetPos(20, 5);slowsay("■■■■■■■■");SetPos(27, 6);slowsay("■■");SetPos(28, 7);slowsay("■■");SetPos(28, 8);slowsay("■");SetPos(27, 8);slowsay("■");SetPos(26, 8);slowsay("■");SetPos(25, 8);slowsay("■");SetPos(24, 8);slowsay("■");SetPos(23, 8);slowsay("■");SetPos(22, 8);slowsay("■");SetPos(21, 8);slowsay("■");SetPos(20, 8);slowsay("■");SetPos(20, 7);slowsay("■");SetPos(19, 7);slowsay("■");SetPos(19, 6);slowsay("■");SetPos(20, 6);slowsay("■");SetPos(21, 6);slowsay("■");SetPos(22, 6);slowsay("■");SetPos(23, 6);slowsay("■");SetPos(24, 7);slowsay("■");SetPos(24, 8);slowsay("■");SetPos(24, 9);slowsay("■");SetPos(24, 10);slowsay("■");SetPos(23, 10);printf("■");SetPos(24, 11);slowsay("■");SetPos(23, 11);printf("■");SetPos(24, 12);slowsay("■");SetPos(23, 12);printf("■");SetPos(22, 12);printf("■");SetPos(23, 13);slowsay("■");SetPos(22, 13);printf("■");SetPos(21, 13);slowsay("■");SetPos(20, 13);slowsay("■");SetPos(19, 12);slowsay("■");SetPos(19, 11);slowsay("■");SetPos(20, 10);slowsay("■");SetPos(21, 10);slowsay("■");SetPos(22, 10);slowsay("■");SetPos(23, 10);slowsay("■");SetPos(24, 10);slowsay("■");SetPos(25, 11);slowsay("■");SetPos(26, 11);slowsay("■");SetPos(27, 11);slowsay("■");SetPos(28, 12);slowsay("■");SetPos(29, 13);slowsay("■");SetPos(30, 13);slowsay("■");SetPos(31, 13);slowsay("■");SetPos(32, 13);slowsay("■");SetPos(33, 13);slowsay("■");SetPos(30, 8);color(rand()%8+1,0);slowsay("_____________________________");SetPos(30, 7);color(rand()%8+1,0);slowsay(" 强 大 脑");SetPos(30, 10);color(rand()%8+1,0);slowsay(" Fwb 出版 ");SetPos(30, 11);color(rand()%8+1,0);slowsay(" 主要锻炼场所 ");int shuliang = 5, xuan1 = -1, xuan2 = -1;while (shuliang--) {srand(time(NULL));xuan1 = rand() % 8+1;while (xuan1 == xuan2)xuan1 = rand() % 8+1;color(xuan1, 0);SetPos(13, 3);Slowsay("▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");for (int i = 3; i <= 15; i++) {SetPos(63, i);Slowsay("▓▓");}for (int i = 63; i >= 13; i--) {SetPos(i, 15);Slowsay("▓");}for (int i = 15; i >= 3; i--) {SetPos(13, i);Slowsay("▓▓");}SetPos(13, 3);xuan2 = rand() % 8+1;while (xuan2 == xuan1) xuan2 = rand() % 8+1;color(xuan2, 0);Slowsay("▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");for (int i = 3; i <= 15; i++) {SetPos(63, i);Slowsay("▓▓");}for (int i = 63; i >= 13; i--) {SetPos(i, 15);Slowsay("▓");}for (int i = 15; i >= 3; i--) {SetPos(13, i);Slowsay("▓▓");}}color(7, 0);
}
void gam6() {while (1) {srand(time(NULL));system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;} printf("看向屏幕左上角,准备接受 3 2 1 的倒计时(Wait 3s)\n");Sleep(3000);system("cls");printf("3");Sleep(1000);system("cls");printf("2");Sleep(1000);system("cls");printf("1");Sleep(1000);system("cls");printf("GO!");Sleep(1000);system("cls");int ans[11][11];int ans1[11][11], ans2[11][11], ans3[11][11], ans4[11][11];int ans5[11][11], ans6[11][11];for (int i = 1; i <= 10; i++) {for (int j = 1; j <= 10; j++) {ans[i][j] = 0;ans1[i][j] = 0;ans2[i][j] = 0;ans3[i][j] = 0;ans4[i][j] = 0;ans5[i][j] = 0;ans6[i][j] = 0;}}int rx, ry;rx = rand() % 6 + 1, ry = rand() % 6 + 1;ans[rx][ry]++;ans1[rx][ry] = 1;rx = rand() % 5 + 1, ry = rand() % 5 + 1;for (int i = rx; i <= rx + 1; i++) {for (int j = ry; j <= ry + 1; j++) {ans[i][j]++;ans2[i][j] = 1;}}rx = rand() % 4 + 1, ry = rand() % 4 + 1;for (int i = rx; i <= rx + 2; i++) {for (int j = ry; j <= ry + 2; j++) {ans[i][j]++;ans3[i][j] = 1;}}rx = rand() % 3 + 1, ry = rand() % 3 + 1;for (int i = rx; i <= rx + 3; i++) {for (int j = ry; j <= ry + 3; j++) {ans[i][j]++;ans4[i][j] = 1;}}rx = rand() % 5 + 1, ry = rand() % 5 + 1;for (int i = rx; i <= rx + 1; i++) {for (int j = ry; j <= ry + 1; j++) {ans[i][j]++;ans5[i][j] = 1;}}rx = rand() % 4 + 1, ry = rand() % 4 + 1;for (int i = rx; i <= rx + 2; i++) {for (int j = ry; j <= ry + 2; j++) {ans[i][j]++;ans6[i][j] = 1;}}int now1[11][11], now2[11][11], now3[11][11], now4[11][11];int NOW2[11][11], NOW3[11][11];for (int i = 1; i <= 10; i++) {for (int j = 1; j <= 10; j++) {now1[i][j] = 0;now2[i][j] = 0;now3[i][j] = 0;now4[i][j] = 0;NOW2[i][j] = 0;NOW3[i][j] = 0;}}
zhe:system("cls");printf("目标盘面:\n\n");for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {if (ans[i][j] >= 4) {printf("%lld", ans[i][j]);} else {if (ans[i][j] & 1) {printf("J");} else {printf("O");}}printf(" ");}printf("\n");}printf("\n你自己的盘面:\n\n 一棵 两棵 三棵 四棵 两棵 三棵\n");for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {if (now1[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (now2[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (now3[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (now4[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (NOW2[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (NOW3[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");printf("\n");}printf("\n输入第 x 棵树的改变,第 y,z 的坐标 (x,y,z)(0,0,0退出)(-1,-1,-1查看答案)(-2,-2,-2查看提示): ");int id, cx, cy;scanf("%lld%lld%lld", &id, &cx, &cy);if (id == cx && cx == cy && id == 0) {return ;}if (id == cx && cx == cy && id == -1) {printf("\n\n答案如下:\n\n");for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {if (ans1[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (ans2[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (ans3[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (ans4[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (ans5[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");for (int j = 1; j <= 6; j++) {if (ans6[i][j]) {printf("■");} else {printf("□");}printf(" ");}printf(" ");printf("\n");}Sleep(10000);goto zhe;}if (id == cx && cx == cy && id == -2) {int chang[11][11];for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {chang[i][j] = now1[i][j] + now2[i][j] + now3[i][j] + now4[i][j] + NOW2[i][j] + NOW3[i][j];}}printf("\n\n当前盘面:\n\n");for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {if (chang[i][j] >= 4) {printf("%lld", chang[i][j]);} else {if (chang[i][j] & 1) {printf("J");} else {printf("O");}}printf(" ");}printf("\n");}Sleep(10000);goto zhe;}if (id == 1) {for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {now1[i][j] = 0;}}for (int i = cx; i <= cx + 0; i++) {for (int j = cy; j <= cy + 0; j++) {now1[i][j] = 1;}}}if (id == 2) {for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {now2[i][j] = 0;}}for (int i = cx; i <= cx + 1; i++) {for (int j = cy; j <= cy + 1; j++) {now2[i][j] = 1;}}}if (id == 3) {for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {now3[i][j] = 0;}}for (int i = cx; i <= cx + 2; i++) {for (int j = cy; j <= cy + 2; j++) {now3[i][j] = 1;}}}if (id == 4) {for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {now4[i][j] = 0;}}for (int i = cx; i <= cx + 3; i++) {for (int j = cy; j <= cy + 3; j++) {now4[i][j] = 1;}}}if (id == 5) {for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {NOW2[i][j] = 0;}}for (int i = cx; i <= cx + 1; i++) {for (int j = cy; j <= cy + 1; j++) {NOW2[i][j] = 1;}}}if (id == 6) {for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {NOW3[i][j] = 0;}}for (int i = cx; i <= cx + 2; i++) {for (int j = cy; j <= cy + 2; j++) {NOW3[i][j] = 1;}}}int chang[11][11];for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {chang[i][j] = now1[i][j] + now2[i][j] + now3[i][j] + now4[i][j] + NOW2[i][j] + NOW3[i][j];}}int flag = 1;for (int i = 1; i <= 6; i++) {for (int j = 1; j <= 6; j++) {if (ans[i][j] >= 4) {if (chang[i][j] != ans[i][j]) {flag = 0;break;}} else {if (chang[i][j] % 2 != ans[i][j] % 2) {flag = 0;break;}}}}if (flag == 1) {system("cls");printf("作答正确(等待 5s)");bi += 10000;zhuan += 1000;zuan += 100;int ttt = rand() % 1000;if (ttt <= 2) dian++;Sleep(5000);return ;}goto zhe;}
}
void zid() {system("cls");printf("请输入密码:");string ccc;cin >> ccc;if (ccc == "我不知道") {printf("\n那你来干嘛?\n");string ttt;cin >> ttt;if (ttt == "抢劫") {printf("......好吧\n");Sleep(2000);system("cls"); } else return ;} else if (ccc == "123456") {printf("你觉得对吗?\n");string eee;cin >> eee;if (eee == "不对") {printf("那你还不滚!");Sleep(2000);return ;} else if (eee == "对") {printf("那好我要告诉你不对\n");string qqq;cin >> qqq;if (qqq == "不信") {printf("好好好我听你的\n");Sleep(2000);} else return ;} else return ;} else {return ;}int lb = bi, lj = zhuan, lz = zuan, ld = dian;system("cls");for (int i = 1; i <= 10000; i++) {int Xx = rand() % 114 + 1, Yy = rand() % 24 + 1;SetPos(Xx, Yy);int ttt = rand() % 10000;if (ttt < 7000) {//银币 int shu = rand() % 100;printf("银币+%d", shu);bi += shu;} else if (ttt < 9000) {//金砖 int shu = rand() % 100;printf("金砖+%d", shu);zhuan += shu;} else if (ttt < 9999) {//钻石 int shu = rand() % 100;printf("钻石+%d", shu);zuan += shu;} else {//殿钻 int shu = rand() % 2;system("color C");printf("殿钻");Sleep(2000);printf("+%d", shu);Sleep(3000);system("color F");dian += shu;}}Sleep(3000);system("cls");printf("收获银币+%d,金砖+%d,钻石+%d,殿钻+%d", bi - lb, zhuan - lz, zuan - lz, dian - ld);Sleep(5000);
}
void jif() {
youlai:system("cls");
//1蓝 2绿 3淡蓝 4红 5粉 6土黄 7白 8灰printf("--------------------------------------------------------------");color(3, 0);printf("\n基础卡型: 龙[%d] 年[%d] 大[%d] 吉[%d]\n", LNG, NIAN, DA, JI);color(1, 0);printf("\n进阶卡型: 万[%d] 家[%d] 欣[%d] 喜[%d]\n", WAN, JIA, XIN, XI);color(5, 0);printf("\n终极卡型: 乐[%d] 欢[%d] 笑[%d] 娱[%d]\n", LE, HUAN, XIAO, YU);color(7, 0);printf("--------------------------------------------------------------");printf("\n\n按:\n-1 抽取基础卡(1999银币/次)\n-2 抽取进阶卡(599金砖/次)\n-3 抽取终极卡(299钻石/次)\n-0 退出\n");int chos;cin >> chos;if (chos == 0) return ;srand(time(NULL));if (chos == 1 && bi >= 1999) {bi -= 1999;int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {LNG++;color(3, 0);printf("恭喜你抽到了");slowsay("---龙"); } else if (xuan <= 800) {JI++;color(3, 0);printf("恭喜你抽到了");slowsay("------吉");} else if (xuan <= 970) {NIAN++; color(3, 0);printf("恭喜你抽到了");slowsay("---------年");} else {DA++;color(3, 0);printf("恭喜你抽到了");slowsay("------------大");}Sleep(1000);color(7, 0); } else if (chos == 2 && zhuan >= 599) {zhuan -= 599;int lia = rand() * rand() % 10 + 1;if (lia <= 9) {int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {LNG++;color(3, 0);printf("恭喜你抽到了");slowsay("---龙"); } else if (xuan <= 800) {JI++;color(3, 0);printf("恭喜你抽到了");slowsay("------吉");} else if (xuan <= 970) {NIAN++; color(3, 0);printf("恭喜你抽到了");slowsay("---------年");} else {DA++;color(3, 0);printf("恭喜你抽到了");slowsay("------------大");}Sleep(1000);color(7, 0);} else {//万家欣喜 int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {JIA++;color(1, 0);printf("恭喜你抽到了");slowsay("---家");} else if (xuan <= 800) {XI++;color(1, 0);printf("恭喜你抽到了");slowsay("------喜");} else if (xuan <= 970) {XIN++; color(1, 0);printf("恭喜你抽到了");slowsay("---------欣");} else {WAN++;color(1, 0);printf("恭喜你抽到了");slowsay("------------万");}Sleep(1000);color(7, 0);}} else if (chos == 3 && zuan >= 299) {zuan -= 299;int sa = rand() * rand() % 100 + 1;if (sa <= 70) {int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {LNG++;color(3, 0);printf("恭喜你抽到了");slowsay("---龙"); } else if (xuan <= 800) {JI++;color(3, 0);printf("恭喜你抽到了");slowsay("------吉");} else if (xuan <= 970) {NIAN++; color(3, 0);printf("恭喜你抽到了");slowsay("---------年");} else {DA++;color(3, 0);printf("恭喜你抽到了");slowsay("------------大");}Sleep(1000);color(7, 0);} else if (sa <= 97) {//万家欣喜 int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {JIA++;color(1, 0);printf("恭喜你抽到了");slowsay("---家");} else if (xuan <= 800) {XI++;color(1, 0);printf("恭喜你抽到了");slowsay("------喜");} else if (xuan <= 970) {XIN++; color(1, 0);printf("恭喜你抽到了");slowsay("---------欣");} else {WAN++;color(1, 0);printf("恭喜你抽到了");slowsay("------------万");}Sleep(1000);color(7, 0);} else {//乐欢笑娱 int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {YU++;color(5, 0);printf("恭喜你抽到了");slowsay("---娱");} else if (xuan <= 800) {HUAN++;color(5, 0);printf("恭喜你抽到了");slowsay("------欢");} else if (xuan <= 970) {XIAO++; color(5, 0);printf("恭喜你抽到了");slowsay("---------笑");} else {LE++;color(5, 0);printf("恭喜你抽到了");slowsay("------------乐");}Sleep(1000);color(7, 0);}}printf ("\n");if (LNG && NIAN && DA && JI) {LNG--, NIAN--, DA--, JI--;int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {JIA++;color(1, 0);printf("已兑换");slowsay("---家");} else if (xuan <= 800) {XI++;color(1, 0);printf("已兑换");slowsay("------喜");} else if (xuan <= 970) {XIN++; color(1, 0);printf("已兑换");slowsay("---------欣");} else {WAN++;color(1, 0);printf("已兑换");slowsay("------------万");}Sleep(1000);color(7, 0);}printf("\n");if (WAN && JIA && XIN && XI) {WAN--, JIA--, XIN--, XI--;int xuan = rand() * rand() % 1000 + 1;if (xuan <= 500) {YU++;color(5, 0);printf("已兑换");slowsay("---娱");} else if (xuan <= 800) {HUAN++;color(5, 0);printf("已兑换");slowsay("------欢");} else if (xuan <= 970) {XIAO++; color(5, 0);printf("已兑换");slowsay("---------笑");} else {LE++;color(5, 0);printf("已兑换");slowsay("------------乐");}Sleep(1000);color(7, 0);}if (LE && HUAN && XIAO && YU) {color(6, 0);printf("你已经抽取了所有的终极卡片!\n");Sleep(1000);printf("获得殿钻->9");dian = 9;Sleep(1000);color(7, 0);return ;}goto youlai;
}
void gam7() {while (1) {srand(time(NULL));system("cls");printf("进入游戏输入 1, 退出输入 0: ");int xcc;cin >> xcc;if (xcc == 0) {return ;}printf("请输入记忆矩阵个数(2<=x<=100): ");int a; cin>>a;printf("看向屏幕左上角,准备接受 3 2 1 的倒计时(Wait 3s)\n");Sleep(3000);system("cls");printf("3");Sleep(1000);system("cls");printf("2");Sleep(1000);system("cls");printf("1");Sleep(1000);system("cls");printf("GO!");Sleep(1000);system("cls");int juzhen[110][11][11];for (int now = 1; now <= a; now++) {for (int i = 1; i <= 10; i++) {for (int j = 1; j <= 10; j++) {int RAN = rand() % 5;if (RAN < 2) {juzhen[now][i][j] = 1;} else {juzhen[now][i][j] = 0;}}}}int miao = 300 * a;printf("请用 %ds 的时间记住以下 %d 个矩阵:\n\n", miao, a);printf(" ");for (int i = 1; i <= a; i++) {printf("%d ", i);}printf("\n");for (int i = 1; i <= 10; i++) {for (int now = 1; now <= a; now++) {for (int j = 1; j <= 10; j++) {if (juzhen[now][i][j] == 1) printf("■ ");else printf("□ ");}printf(" ");}printf("\n");}for (int i = 1LL * miao; i >= 0; i--) {SetPos(0, 1);printf("剩余: [%d]分 [%d]秒", i/60, i%60);Sleep(1000);}system("cls");printf("记忆时间到\n");Sleep(2000);printf("用 30s 的时间回想记忆的片段\n");Sleep(30000);while (1) {system("cls");printf("正在快速check片段重复...\n");int yong = 10;
hahah:yong--;int ge = rand() % a + 1;int bian = rand() % 5 + 2;int shu = 100, realans = -1;int pian[11][11], tx = 1, ty = 1;while (shu--) {int rx = rand() % (10 - bian + 1) + 1, ry = rand() % (10 - bian + 1) + 1;for (int i = rx; i <= rx + bian - 1; i++) {ty = 1;for (int j = ry; j <= ry + bian - 1; j++) {pian[tx][ty++] = juzhen[ge][i][j];}tx++;}int sum = 0;//验重 for (int now = 1; now <= a; now++) {for (int i = 1; i <= 10 - bian + 1; i++) {for (int j = 1; j <= 10 - bian + 1; j++) {int flag = 1;int TX = 1, TY = 1;for (int topi = i; topi <= i + bian - 1; topi++) {TY = 1;for (int topj = j; topj <= j + bian - 1; topj++) {if (juzhen[now][topi][topj] != pian[TX][TY++]) {flag = 0;break;}}TX++;if (flag == 0) {break;}}sum += flag;}}}if (sum == 1) {realans = ge;break;}}if (realans == -1) {if (yong>0) goto hahah;printf("所有片段重复...\n抱歉,请回吧\n\n");Sleep(3000);return ;}printf("当前查询的片段为:\n\n");for (int i = 1; i <= bian; i++) {for (int j = 1; j <= bian; j++) {if (pian[i][j]) printf("■ ");else printf("□ ");}printf("\n");}
aggaga:printf("\n请输入你认为的答案:\n");int daan;cin >> daan;if (daan != realans) {system("color C");printf("回答错误\n");Sleep(2000);system("color F");goto aggaga;}system("cls");printf("回答正确");Sleep(5000);printf("\n\n退出请输入 0,否则输入 1:");int chos;cin >> chos;if (chos == 0) return ;}}
}
signed main() {HideCursor(1);Read();Start();
agaga:system("cls");printf("-------------------------------------------------------------\n");printf("经验: %lld 等级: ", zuan / 1000 + dian * 100); if ((zuan / 1000 + dian * 100) <= 5) printf("青衿");else if ((zuan / 1000 + dian * 100) <= 10) printf("簪缨");else if ((zuan / 1000 + dian * 100) <= 20) printf("辔头");else if ((zuan / 1000 + dian * 100) <= 40) printf("及笄");else if ((zuan / 1000 + dian * 100) <= 80) printf("[进阶]豆蔻");else if ((zuan / 1000 + dian * 100) <= 160) printf("[中阶][新]知己");else if ((zuan / 1000 + dian * 100) <= 320) printf("[高阶][欲胜]天际");else if ((zuan / 1000 + dian * 100) <= 640) printf("[终结][称霸][无尽]世纪");else if ((zuan / 1000 + dian * 100) <= 1024) printf("[巨无霸][强盗][高级统帅][苍穹]计数者");else printf("[膨胀][未知][无敌][天际翱翔者][北海蛟龙尊][凤凰随舞]麟龙");printf("\n");printf("目前拥有:");if (bi < 1000) printf("银币[%lld]", bi);else if (bi < 1000000) printf("银币[%.1lfk]", 1.0 * bi / 1000.0);else printf("银币[%.1lfbw]", 1.0 * bi / 1000000.0);printf(" ");if (zhuan < 1000) printf("金砖[%lld]", zhuan);else if (zhuan < 1000000) printf("金砖[%.1lfk]", 1.0 * zhuan / 1000.0);else printf("金砖[%.1lfbw]", 1.0 * zhuan / 1000000.0);printf(" ");if (zuan < 1000) printf("钻石[%lld]", zuan);else if (zuan < 1000000) printf("钻石[%.1lfk]", 1.0 * zuan / 1000.0);else printf("钻石[%.1lfbw]", 1.0 * zuan / 1000000.0);printf(" ");if (dian < 1000) printf("殿钻[%lld]", dian);else if (dian < 1000000) printf("殿钻[%.1lfk]", 1.0 * dian / 1000.0);else printf("殿钻[%.1lfbw]", 1.0 * dian / 1000000.0);printf("\n-------------------------------------------------------------\n");
// system("cls");printf("项目:\n\n1.数络叠加\n2.速算秘境\n3.记忆矩阵\n4.大数乘除\n5.时针逆转\n6.植此青绿\n7.碎片记忆\n8.幸运转盘\n9.递增转盘\n10.仓库\n11.自动刷卡器\n12.新春集福\n");if (dian >= 10 && dian < 1e9) {system("cls");printf("喂,等等\n\n");Sleep(1000);printf("你是不是有 10 个殿堂钻石了\n\n");Sleep(1000);printf("嘿嘿,我刚注意到\n\n");Sleep(1000);printf("那,我要骄傲的宣布——\n\n");Sleep(3000);printf("你成功的把我打败了...\n\n");Sleep(500);printf("获得线索:[乱码^& 废弃... 与失联--]");system("color C");int ttttt = rand() % 4;if (ttttt == 1) {cout << endl;slowsay(".......................................");cout << endl;cout << endl;Sleep(1000);slowsay("怎么不一样???\n\n\n\n\n\n是要开始了吗?......");Sleep(500);dian = 1e9;bi = 1e9;zhuan = 1e9;}return 0;}int x;cin>>x;if(x==1) gam1();else if (x==2) gam2();else if (x==3) gam3();else if (x==4) gam4();else if (x==5) gam5();else if (x==6) gam6();else if (x==7) gam7();else if (x==8) xin5();else if (x==9) xin6();else if (x==10) xin7();else if (x==11) zid();else if (x==12) jif();Save();goto agaga;return 0;
}
这篇关于C++游戏(自创)(新)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!