版本比较
迷宫游戏1.0
正文
增加 29 行删除 29 行
7 行未改动89101112121314151516171819202122232425252627282912 行未改动4243444546464748495014 行未改动6566676869697071727319 行未改动939495969797989910010110110210310410516 行未改动12212312412512612612712812913020 行未改动15115215315415515515615715815941 行未改动20120220320420520520620720820927 行未改动23723823924024124124224324424510 行未改动25625725825926026026126226326430 行未改动29529629729829929930030130230314 行未改动31831932032132232232332432532628 行未改动3553563573583593593603613623632 行未改动36636736836937037037137237337410 行未改动3853863873883893893903913923933 行未改动39739839940040140140240340440519 行未改动42542642742842942943043143243243343443543629 行未改动46646746846947047047147247347445 行未改动52052152252352452452552652752752852953053053153253353353453553653653753853953954054154254354254354454554654734 行未改动7 行未改动#include<thread>
using namespace std;
const int MAXN = 21; const int MAXN = 21;
int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};int len, x, y, Level = 1, hp = 3, CD = 0; // len是子弹数量 int len, x, y, Level = 1, hp = 3, CD = 0; // len是子弹数量bool die = false;char c[MAXN][MAXN];void slowsay(int v, string s) { for(int i = 0; i < s.size(); i++) { cout << s[i]; Sleep(v); } return;}struct P { // 子弹信息 struct P { // 子弹信息 int x, y, d;}zd[MAXN];void M() { for(int i = 1; i <= len; i++) {12 行未改动 if(x == zd[i].x && y == zd[i].y) { die = true; return; } } } } } if(CD % 3 == 0) { for(int i = 1; i <= 20; i++) {14 行未改动 else if(i == x && j < y && c[i][j + 1] != '#' && c[i][j + 1] != 'L') { zd[++len] = {i, j + 1, 3}; c[zd[len].x][zd[len].y] = 'Z'; } } } } } }}19 行未改动 } } } } c[2][2] = '@', c[19][19] = 'L'; c[2][2] = '@', c[19][19] = 'L';}void game(int p) { a : system("cls"); system("cls"); len = CD = 0; if(hp <= 0) { cout << "你的hp没有了!\n"; system("pause");16 行未改动 hp--; cout << "你死了!\n"; Sleep(2000); goto a; } } while(!kbhit()) { } char g = _getch(); if(g == 'Q') {20 行未改动 hp--; cout << "你死了!\n"; Sleep(2000); goto a; } } M(); CD++; if(c[x][y] == 'V') { hp++;41 行未改动 slowsay(10, "在迷宫里,会有一些道具,V是回血的道具。注意,如果子弹打到道具,道具将被摧毁。当然,怪物也会被怪物打死。"); system("pause"); slowsay(10, "如果你发现地图有问题,按Q刷新地图\n"); system("pause"); slowsay(10, "接下来其他内容,就靠你自己探索了qwq\n"); slowsay(10, "接下来其他内容,就靠你自己探索了qwq\n");}
int main() { srand(time(0));27 行未改动 system("pause"); system("cls"); goto a; return 0;} }```
改编的地狱难度游戏
10 行未改动#define BLUE(s) std::cout << BLUE << s << RESET;
using namespace std;
const int MAXN = 1e2; const int MAXN = 1e2;const std::string RED = "\033[31m"; // 红色const std::string GREEN = "\033[32m"; // 绿色const std::string YELLOW = "\033[33m"; // 黄色const std::string BLUE = "\033[34m"; // 蓝色30 行未改动 if(x == zd[i].x && y == zd[i].y) { die = true; return; } } } } } if(CD % 3 == 0) { for(int i = 1; i <= 20; i++) {14 行未改动 else if(i == x && j < y && c[i][j + 1] != '#' && c[i][j + 1] != 'L') { zd[++len] = {i, j + 1, 3}; c[zd[len].x][zd[len].y] = 'Z'; } } } } } }}28 行未改动 } } } } c[2][2] = '@', c[19][19] = 'L'; c[2][2] = '@', c[19][19] = 'L';}void game(int p) { cout << "这个游戏是由PJL改编的!\n"; cout << "难度较高,但是被PJL削了,所以不难!\n";2 行未改动 cout << "废话不多说,开始游戏!"; Sleep(500); system("cls"); a : system("cls"); system("cls"); len = CD = 0; ICD = 10; if(hp <= 0) { cout << "你的hp没有了!\n";10 行未改动 for(int j = 1; j <= 20; j++) { if(c[i][j] == 'J') { BLUE("J"); c[i][j] = '.'; } } else { cout << c[i][j]; } }3 行未改动 hp--; cout << "你死了!\n"; Sleep(2000); goto a; } } while(!kbhit()) { } char g = _getch(); if(g == 'Q') {19 行未改动 else if(g == 'J' && ICD <= 0) { int D1 = rand() % 4, D2 = rand() % 4; for(int x1 = x, y1 = y; c[x1][y1] != '#'; x1 += dx[D1], y1 += dy[D1]) { c[x1][y1] = 'J'; } } for(int x1 = x, y1 = y; c[x1][y1] != '#'; x1 += dx[D2], y1 += dy[D2]) { c[x1][y1] = 'J'; } } c[x][y] = '@'; for(int i = 1; i <= len; i++) { if(c[zd[i].x][zd[i].y] == 'J' && zd[i].d != -1) { zd[i].d = -1;29 行未改动 hp--; cout << "你死了!\n"; Sleep(2000); goto a; } } if(stop <= 0) { system("color 0F"); M(); }45 行未改动}void gz() { slowsay(10, "在这个游戏中,'#'是墙,'.'是路,你的位置是'@',终点是L,WASD移动\n"); system("pause"); system("cls"); system("cls"); slowsay(10, "这个迷宫里危机四伏,会有大量怪物'P'。\n"); system("pause"); system("cls"); system("cls"); slowsay(10, "TA虽然不会移动,但是怪物会向你发射子弹,敌人的子弹是'Z'。你被打到就会死翘翘,当然,你也可以跑过去徒手干掉它。但估计你没干几个就被射成刺猬了。。。\n"); system("pause"); system("cls"); system("cls"); slowsay(10, "在迷宫里,会有一些道具,V是回血的道具。注意,如果子弹打到道具,道具将被摧毁,这也会导致迷宫里道具变得极稀有。当然,怪物也会被怪物打死。\n"); system("pause"); system("cls"); system("cls"); slowsay(50, "emmm...\n"); system("pause"); system("cls"); system("cls"); slowsay(10, "作者发现这个游戏太难了,于是降低了难度!按下J可发电,可向随机四个方向其中的两个发射,有极小概率会只发射一个,道具也会被电清除!按下K可时间停止5回合!这两个技能CD共享!\n"); system("pause"); system("cls"); system("cls"); slowsay(10, "如果你发现地图有问题,按Q刷新地图\n"); system("pause"); system("cls"); slowsay(10, "接下来其他内容,就靠你自己探索了qwq\n"); system("cls"); slowsay(10, "接下来其他内容,就靠你自己探索了qwq\n");}
int main() { srand(time(0));34 行未改动