走迷宫代码
  • 板块学术版
  • 楼主封禁用户
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/5/19 21:18
  • 上次更新2024/5/20 11:15:34
查看原帖
走迷宫代码
330230
封禁用户楼主2024/5/19 21:18
#include <ctime>
#include <cmath>
#include <conio.h>
#include <cstring>
#include <iostream>
#include <Windows.h>
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
const int N = 1e+4, Number_of_maps = 5;
int dollar, gold, diamonds, antitank_grenade, g = 0, k = 0;
char password[N];
char map1[12][12] = 
{
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'},//asasasaawawwsaawaassssddsdasaassddsddddwqwdddsss
	{'|', ' ', ' ', ' ', '!', '$', '#', '#', '#', '#', ' ', 'O'},
	{'|', ' ', '#', ' ', ' ', ' ', '*', '#', '#', ' ', ' ', '|'},
	{'|', ' ', '#', '!', '#', ' ', '$', '!', ' ', ' ', '!', '|'},
	{'|', ' ', '!', ' ', '#', '#', ' ', ' ', ' ', '!', '#', '|'},
	{'|', 'A', ' ', ' ', '#', 'D', '#', '#', '#', ' ', ' ', '|'},
	{'|', '!', '!', 'G', 'D', '#', '!', '#', ' ', ' ', '#', '|'},
	{'|', ' ', ' ', ' ', '!', '#', ' ', ' ', '!', ' ', '#', '|'},
	{'|', ' ', '!', '#', '#', '#', '#', ' ', '#', ' ', ' ', '|'},
	{'|', ' ', ' ', ' ', '!', '!', '#', ' ', '#', '!', ' ', '|'},
	{'|', '!', '!', ' ', ' ', ' ', ' ', ' ', '!', '#', ' ', '|'},
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', '-'}
};
char map2[12][12] = 
{
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'},//aawwwwdaaaaasaawaasssswqddssdaaqsassdqdsdddwwwwdssddqsss
	{'|', ' ', ' ', ' ', '!', ' ', ' ', 'G', '$', 'D', 'G', '|'},
	{'|', ' ', '#', ' ', ' ', ' ', '*', '#', '#', ' ', '#', '|'},
	{'|', ' ', '#', '!', '#', ' ', ' ', '!', ' ', ' ', '!', '|'},		
	{'|', ' ', '!', 'G', '#', '#', ' ', ' ', ' ', '$', '!', '|'},
	{'|', 'G', '#', 'G', '#', '$', '#', '#', '#', ' ', 'A', 'O'},
	{'|', '!', '$', 'D', '$', '#', '$', '$', '#', '#', '#', '|'},
	{'|', ' ', '#', '#', '!', '#', '$', ' ', ' ', ' ', '#', '|'},
	{'|', ' ', '!', '#', '#', '#', '$', ' ', '$', ' ', ' ', '|'},
	{'|', ' ', ' ', '!', '!', '!', '$', ' ', '#', '!', ' ', '|'},
	{'|', '!', '!', ' ', ' ', ' ', ' ', ' ', '!', '$', '#', '|'},
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', ' ', '-', '-'}
};
char map3[12][12] =
{
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'},//wadwwdswdddsswwawwaaadddwdawwwwaaddssasaadqawadssaaaaadssddswwawwdsaaaqwqwqwqwa
	{'|', '#', '!', '!', '!', '!', '#', 'G', '$', ' ', ' ', '|'},
	{'|', '#', '#', '#', '*', '*', '*', '#', '#', ' ', '#', '|'},
	{'|', '!', '#', '!', '#', 'D', '#', '!', ' ', ' ', '!', '|'},
	{'|', '*', '!', 'A', 'G', '#', 'A', ' ', ' ', 'D', '!', '|'},
	{'|', '$', 'A', 'A', 'A', '$', '#', '#', '#', ' ', '$', '|'},
	{'|', '!', '$', 'A', '!', '#', 'G', 'G', ' ', ' ', '#', '|'},
	{'|', '#', 'A', 'A', '*', '#', '*', '!', '!', ' ', '#', '|'},
	{'|', '*', '!', '#', '*', '#', 'G', '#', 'G', ' ', ' ', '|'},
	{'|', '!', '#', '#', '!', '!', 'G', 'G', '#', '!', ' ', '|'},
	{'|', '!', '!', '*', '#', 'G', 'G', '#', '!', '#', 'D', '|'},
	{'-', ' ', '-', '-', '-', '-', 'O', '-', '-', '-', '-', '-'}
};
char map4[12][12] = 
{
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'},//awwqaaaaswwwdddwwaaawawqwaaaswadddddsssddwdqwdwsaawaaaassqdsswaassasdqssdaqaqsaa
	{'|', 'A', 'A', 'A', '*', '*', '#', 'D', '$', '#', 'G', '|'},
	{'|', '#', 'A', '!', ' ', ' ', '*', '#', '#', '!', '#', '|'},
	{'|', ' ', '#', '!', '#', ' ', ' ', '!', ' ', ' ', '!', '|'},
	{'|', ' ', '!', ' ', '#', '#', ' ', ' ', ' ', '$', '!', '|'},
	{'|', ' ', ' ', ' ', '#', '$', '#', '#', '#', ' ', ' ', '|'},
	{'|', '!', '$', ' ', ' ', '#', '$', '$', ' ', 'A', '#', '|'},
	{'|', '*', ' ', ' ', '!', '#', ' ', ' ', '!', '*', '#', '|'},
	{'|', '!', '!', '#', '#', '#', '$', ' ', '$', '#', 'A', '|'},
	{'|', '!', '#', 'G', 'A', '!', '$', '#', '#', '!', ' ', '|'},
	{' ', '!', '!', '#', ' ', '#', '#', '$', '!', '#', '$', 'O'},
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'}
};
char map5[12][12] = 
{
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'},//wwwaaassawwwwdswdqawwsdddawqwwwdaaaqaasaawqaasqdqdssqsdasaswasasqdsqsddaaas
	{'|', 'G', '#', 'A', '!', 'A', '#', 'A', '$', 'A', 'G', '|'},
	{'|', 'A', '#', 'A', 'A', 'A', '*', '#', '#', 'A', '#', '|'},
	{'|', '#', '#', '!', '#', '#', '#', '!', '*', '*', '!', '|'},
	{'|', '!', '!', '$', '#', '$', '#', '$', '*', '$', '!', '|'},
	{'|', '!', '!', '#', '#', '#', '#', '#', '#', '*', '$', '|'},
	{'|', '!', '$', '$', 'A', '*', '$', '$', 'G', '!', '#', '|'},
	{'|', 'A', 'D', 'A', '!', '#', 'D', 'G', '!', '#', '#', '|'},
	{'|', 'A', '!', '#', '#', '#', '$', 'A', '$', 'A', 'A', '|'},
	{'|', '#', '#', '#', '!', '!', '$', '$', '#', '!', 'A', '|'},
	{'|', '!', '!', '#', 'D', '#', 'D', 'A', '!', '#', '$', '|'},
	{'-', ' ', '-', '-', '-', '-', '-', '-', '-', '-', 'O', '-'}
};
char map6[12][12] = 
{
	{'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'},//wwwaaassawwwwdswdqawwsdddawqwwwdaaaqaasaawqaasqdqdssqsdasaswasasqdsqsddaaas
	{'|', 'G', '#', 'A', '!', 'A', '#', 'A', '$', 'A', 'G', '|'},
	{'|', 'A', '#', 'A', 'A', 'A', '*', '#', '#', 'A', '#', '|'},
	{'|', '#', '#', '!', '#', '#', '#', '!', '*', '*', '!', '|'},
	{'|', '!', '!', '$', '#', '$', '#', '$', '*', '$', '!', '|'},
	{'|', '!', '!', '#', '#', '#', '#', '#', '#', '*', '$', '|'},
	{'|', '!', '$', '$', 'A', '*', '$', '$', 'G', '!', '#', '|'},
	{'|', 'A', 'D', 'A', '!', '#', 'D', 'G', '!', '#', '#', '|'},
	{'|', 'A', '!', '#', '#', '#', '$', 'A', '$', 'A', 'A', '|'},
	{'|', '#', '#', '#', '!', '!', '$', '$', '#', '!', 'A', '|'},
	{'|', '!', '!', '#', 'D', '#', 'D', 'A', '!', '#', '$', '|'},
	{'-', ' ', '-', '-', '-', '-', '-', '-', '-', '-', 'O', '-'}
};
char Coordinate[5][4] = 
{
	{1, 11, 11, 10},
	{5, 11, 11, 9},
	{11, 6, 11, 1},
	{10, 11, 10, 0},
	{11, 10, 11, 1}
};
string change[3][3] = 
{
	{"-2$", "-5G", "-1D"},
	{"-1D", "+2A", "+5A"},
	{"2$", "5G", "1D"}
};
struct Time
{
	int Year, Month, Day, Hour, Minute, Second, Number;
	string Things;
};
struct Map
{
	char Plat[12][12];
};
Time a[N];
Map plat[Number_of_maps];
bool Judgment(char k)
{
	if (k == ' ' || k == 'A' || k == 'D' || k == 'G' || k == '$') return true;
	return false;
}
bool Determine(string p)
{
	if (p == "MG.cpp" || p == "c++" || p == "." || p == "WNMM" || p == "Xym,%3fGh7&64" || p == "Tzyap4ry882" || p == "Zlh32456^723/?>" || p == "Yzm20110622" || p == "Ldx330381154137" || p == "Zhsuwqii1kws^$&%$23?>|{P}[k]" || p == "Ckx01385hfew?,:i" || p == "Yjh0239djijwias{FSE213fs}rqwasdu[4]wfse[e3{dddddw}]") return true;
	else return false;
}
bool Antitank_grenade(int x, int y, char map[][12])
{
	if (map[x][y] != '-' && map[x][y] != '|') return true;
	else return false;
}
bool String_to_number(char M[])
{
	int condition = 0;
	bool flag = false;
	for (int i = 0; i < strlen(M); i ++ ) if (M[i] >= '0' && M[i] <= '9') condition ++ ;
	if (condition == strlen(M)) flag = true;
	return flag;
}
void Point()
{
	for (int i = 1; i <= 6; i ++ ) printf("."), Sleep(100);
}
void Rule()
{
	printf("1.'O'处为你现在所处在的位置; \n");
	printf("2.'!'处为炸弹, 碰上就会被炸死; \n");
	printf("3.'|'与'-'处为墙壁, 碰上就会被撞死; \n");
	printf("4.'#'处为怪兽, 碰上就会被吃掉; \n");
	printf("5.'A'处为手雷, 碰上就能够把周围的8个格子吃掉; \n");
	printf("5.'D'处为钻石, 碰上就能获得1颗钻石; \n");
	printf("6.'G'处为金币, 碰上就能够获得1枚金币; \n");
	printf("7.'*'处为地雷, 碰上就会被炸死; \n");
	printf("8.' '处为通道, 是你可以走的地方\n");
	printf("9.手雷获取方式: (1)可以走到迷宫中的'A'处获得\n");
	printf("                (2)可以通过兑换获得: ①2美元兑换1枚手雷\n");
	printf("                                     ②5枚金币兑换2枚手雷\n");
	printf("                                     ③1颗钻石兑换5枚手雷\n");
	printf("                              (兑换的优先等级: 美元 > 金币 > 钻石)\n\n\n");
	system("pause");
}
void Iinitialization(char a[][12])
{
	for (int i = 0; i < 12; i ++ ) for (int j = 0; j < 12; j ++ ) plat[k].Plat[i][j] = a[i][j];
	k ++ ;
}
void Record(string delta)
{
	time_t nowtime;
	time(&nowtime);
	tm *p = localtime(&nowtime);
	a[g].Number = g + 1, a[g].Year = p -> tm_year + 1900, a[g].Month = p -> tm_mon + 1, a[g].Day = p -> tm_mday, a[g].Hour = p -> tm_hour, a[g].Minute = p -> tm_min, a[g].Second = p -> tm_sec, a[g].Things = delta, g ++ ;
}
void Reward(char k)
{
	if (k == 'A' || k == 'D' || k == 'G' || k == '$')
	{
		if (k == 'A') antitank_grenade ++ ;
		else if (k == 'D') diamonds ++ ;
		else if (k == 'G') gold ++ ;
		else if (k == '$') dollar ++ ;
	}
}
void View_game_rules()
{
	int Number = 0; 
	while (true)
	{
		char View_rules = getch();
		if (View_rules >= '0' && View_rules <= '9')
		{
			Number = View_rules - 47;
			if (Number == 1)
			{
				printf("0\n游戏开始\n");
				return;
			}
			else if (Number == 2) printf("1\n"), Rule();
			else printf("%d\n您输入的数字错误, 请重新输入: ", Number - 1);
		}
		else printf("%c\n您输入的内容错误, 请重新输入: ", View_rules);
		if (Number == 1 || Number == 2) break;
	}
}
void print(char map[][12])
{
	for (int i = 0; i < 12; i ++ )
	{
		for (int j = 0; j < 12; j ++ ) printf("%c ", map[i][j]);
		printf("\n");
	}
}
void print_map(int n, char map[][12], bool flag)
{
	if (flag) printf("%c\n", n);
	print(map);
	if (flag) Sleep(750);
}
void exchange(int m, int add)
{
	for (int i = 0; i < 5; i ++ ) system("cls"), printf("准备对换手雷, 价值: %s\n请耐心等待", change[2][m - 1].c_str()), Point();
	for (int i = 0; i < 10; i ++ ) system("cls"), printf("正在兑换手雷, 价值: %s\n兑换中", change[2][m - 1].c_str()), Point();
	system("cls"), printf("  %s\n  %s\n兑换成功!\n", change[0][m - 1].c_str(), change[1][m - 1].c_str()), Record(change[0][m - 1]), Record(change[1][m - 1]), Sleep(1000), antitank_grenade += add, system("pause");
}
void print_labyrinth()
{
	printf("请问您要选择哪种迷宫?\n");
	for (int i = 0; i < Number_of_maps; i ++ ) print_map(i + 97, plat[i].Plat, true);
}
int Enter_the_type_of_labyrinth()
{
	int option = 0;
	printf("请输入要选择的迷宫: ");
	while (true)
	{
		char Option = getch();
		if (Option >= 'a' && Option <= 'z' || Option >= 'A' && Option <= 'Z')
		{
			if (Option >= 'A' && Option <= 'Z') option = Option - 64;
			if (Option >= 'a' && Option <= 'z') option = Option - 96;
			if (!(option >= 1 && option <= 5)) printf("%c\n您选择的迷宫错误, 请重新输入: ", Option);
			else print_map(option + 96, plat[option - 1].Plat, true);
			Sleep(1000);
		}
		else printf("%c\n您输入的内容错误, 请重新输入: ", Option);
		if (option >= 1 && option <= 5) break;
	}
	return option;
}
void Stop(char k, string Name, char Map[][12], int S)
{
	system("cls");
	print_map(0, Map, false);
	Sleep(750);
	system("cls");
	printf("Game Over!!!\n您用了%d步, 获得了%d枚手雷, %d颗钻石, %d枚金币, %d美元\n", S, antitank_grenade, diamonds, gold, dollar);
	if (k == '#') printf("你被怪物吃掉了, ");
	else if (k == '|' || k == '-') printf("你撞在墙上了, 被撞死了, ");
	else if (k == '!') printf("你被炸弹炸死了, ");
	printf("%s, 请重新进行该游戏!\n'走迷宫'这个游戏一直在等着你哟(^U^)ノ~YO!!!\n", Name.c_str());
	system("pause");
}
void Labyrinth(int n_start, int m_start, int n_end, int m_end, string N, char map[][12])
{
	bool flag = false;
	int x = n_start, y = m_start, Steps = 0;
	dollar = 0, gold = 0, diamonds = 0, antitank_grenade = 0;
	while (true)
	{
		print_map(0, map, false);
		printf("上(w)下(s)左(a)右(d)放手雷(q)兑换手雷(f)查看(c): ");
		char motion = getch();
		Steps ++ ;
		if (motion == 'w')
		{
			if (Judgment(map[x - 1][y])) map[x][y] = ' ', x -- , Reward(map[x][y]), map[x][y] = 'O';
			else
			{
				map[x][y] = ' ', x -- , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
				return;
			}
		}
		if (motion == 's')
		{
			if (Judgment(map[x + 1][y])) map[x][y] = ' ', x ++ , Reward(map[x][y]), map[x][y] = 'O';
			else
			{
				map[x][y] = ' ', x ++ , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
				return;
			}
		}
		if (motion == 'a')
		{
			if (Judgment(map[x][y - 1])) map[x][y] = ' ', y -- , Reward(map[x][y]), map[x][y] = 'O';
			else
			{
				map[x][y] = ' ', y -- , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
				return;
			}
		}
		if (motion == 'd')
		{
			if (Judgment(map[x][y + 1])) map[x][y] = ' ', y ++ , Reward(map[x][y]), map[x][y] = 'O';
			else
			{
				map[x][y] = ' ', y ++ , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
				return;
			}
		}
		if (motion == '\xE0')
		{
			flag = true;
			motion = getch();
			if (motion == 'H')
			{
				if (Judgment(map[x - 1][y])) map[x][y] = ' ', x -- , Reward(map[x][y]), map[x][y] = 'O';
				else
				{
					map[x][y] = ' ', x -- , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
					return;
				}
			}
			if (motion == 'P')
			{
				if (Judgment(map[x + 1][y])) map[x][y] = ' ', x ++ , Reward(map[x][y]), map[x][y] = 'O';
				else
				{
					map[x][y] = ' ', x ++ , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
					return;
				}
			}
			if (motion == 'K')
			{
				if (Judgment(map[x][y - 1])) map[x][y] = ' ', y -- , Reward(map[x][y]), map[x][y] = 'O';
				else
				{
					map[x][y] = ' ', y -- , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
					return;
				}
			}
			if (motion == 'M')
			{
				if (Judgment(map[x][y + 1])) map[x][y] = ' ', y ++ , Reward(map[x][y]), map[x][y] = 'O';
				else
				{
					map[x][y] = ' ', y ++ , map[x][y] = 'O', Stop(map[x][y], N, map, Steps);
					return;
				}
			}
		}
		if (motion == 'q')
		{
			Steps -- ;
			if (antitank_grenade > 0)
			{
				if (Antitank_grenade(x - 1, y - 1, map)) map[x - 1][y - 1] = ' ';
				if (Antitank_grenade(x - 1, y, map)) map[x - 1][y] = ' ';
				if (Antitank_grenade(x - 1, y + 1, map)) map[x - 1][y + 1] = ' ';
				if (Antitank_grenade(x, y - 1, map)) map[x][y - 1] = ' ';
				if (Antitank_grenade(x, y + 1, map)) map[x][y + 1] = ' ';
				if (Antitank_grenade(x + 1, y - 1, map)) map[x + 1][y - 1] = ' ';
				if (Antitank_grenade(x + 1, y, map)) map[x + 1][y] = ' ';
				if (Antitank_grenade(x + 1, y + 1, map)) map[x + 1][y + 1] = ' ';
				antitank_grenade -- ;
			}
			else
			{
				system("cls");
				printf("您的手雷量不够, 请您继续积攒或兑换手雷, 再使用此功能, 谢谢!\n");
				system("pause");
			}
		}
		if (motion == 'f')
		{
			Steps -- ;
			if (dollar > 1) exchange(1, 1), dollar -= 2;
			else if (gold > 4) exchange(2, 2), gold -= 5;
			else if (diamonds > 0) exchange(3, 5), diamonds -- ;
			else
			{
				system("cls");
				printf("您的钱不够, 请您继续收集\n");
				system("pause"); 
			}
		}
		if (motion == 'c')
		{
			Steps -- ;
			system("cls");
			print_map(0, map, false);
			printf("请问你要查看什么: 游戏规则及须知(t)目前步数(s)目前得到的手雷数量(a)目前得到钻石的数量(d)目前得到的金币数量(g)目前得到的钱数(k)历史账单(c)返回(q): ");
			char t = getch();
			system("cls");
			if (t == 't') Rule();
			else if (t == 's')
			{
				printf("目前走了%d步\n", Steps);
				system("pause");
			}
			else if (t == 'a')
			{
				printf("目前得到了%d枚手雷\n", antitank_grenade);
				system("pause");
			}
			else if (t == 'd')
			{
				printf("目前得到了%d颗钻石\n", diamonds);
				system("pause");
			}
			else if (t == 'g')
			{
				printf("目前得到了%d枚金币\n", gold);
				system("pause");
			}
			else if (t == 'k')
			{
				printf("目前得到了%d美元\n", dollar);
				system("pause");
			}
			else if (t == 'c')
			{
				system("cls");
				if (g == 0) printf("您目前还没有账单!!!\n"); 
				else
				{
					printf("----------------------------\n");
					for (int i = g - 1; i >= 0; i -- )
					{
						if (g - a[i].Number + 1 >= 10) printf("|%d.%d年", g - a[i].Number + 1, a[i].Year);
						else printf("|%d. %d年", g - a[i].Number + 1, a[i].Year);
						if (a[i].Month >= 10) printf("%d月 ", a[i].Month);
						else printf("0%d月 ", a[i].Month);
						if (a[i].Hour >= 10) printf("%d点", a[i].Hour);
						else printf(" %d点", a[i].Hour);
						if (a[i].Minute >= 10) printf("%d分", a[i].Minute);
						else printf("0%d分", a[i].Minute);
						if (a[i].Second >= 10) printf("%d秒|\n", a[i].Second);
						else printf("0%d秒|\n", a[i].Second);
						printf("|                          |\n");
						printf("|           %s            |\n", a[i].Things.c_str());
						printf("|                          |\n");
						printf("----------------------------\n");
					}
				}
				system("pause");
			}
			else if (t == 'q') continue;
			else if (t != 't' && t != 's' && t != 'a' && t != 'd' && t != 'g' && t != 'k' && t != 'c' && t != 'y' && t != 'q')
			{
				system("cls");
				printf("抱歉, %s, 系统不知道您发出的指令是什么意思\n", N.c_str());
				system("pause");
			}
		}
		if (motion != 'a' && motion != 'd' && motion != 'w' && motion != 's' && motion != 'q' && motion != 'f' && motion != 'c' && flag == false)
		{
			system("cls");
			printf("抱歉, %s, 系统不知道您发出的指令是什么意思\n", N.c_str());
			system("pause");
		}
		system("cls");
		if (x == n_end && y == m_end) break;
	}
	print(map);
	printf("您走完这个迷宫共用了%d步, 获得了%d枚手雷, %d颗钻石, %d枚金币, %d美元\n欢迎%s再次挑战, '走迷宫'的游戏会一直等着你哟(^U^)ノ~YO!!!\n", Steps, antitank_grenade, diamonds, gold, dollar, N.c_str());
	system("pause");
}
void Labyrinth_main(string n, string p)
{
	if (p == "") n = "";
	else if (p == "") n = "";
	else if (p == "") n = "";
	else if (p == "") n = "";
	else if (p == "Ldx" || p == "WNMM" || p == "MG.cpp" || p == "c++" || p == ".") n = "琴声如瑟月徽暗";
	else if (p == "") n = "";
	else if (p == "") n = "";
	else if (p == "") n = "";
	printf("欢迎%s来到'走迷宫'的游戏!\n你是(1)否(0)要查看规则?\n回答: ", n.c_str());
	View_game_rules();
	Sleep(1000);
	system("cls");
	print_labyrinth();
	int option = Enter_the_type_of_labyrinth();
	system("cls");
	Labyrinth(Coordinate[option - 1][0], Coordinate[option - 1][1], Coordinate[option - 1][2], Coordinate[option - 1][3], n, plat[option - 1].Plat);
}
void Password()
{
	int view_rules, score = 0, x, y, time;
	string password, name;
	printf("请输入密码: ");
	cin >> password;
	if (Determine(password)) Labyrinth_main(name, password);
	else
	{
		printf("密码输入错误, 请重新输入密码: ");
		cin >> password;
		if (Determine(password)) Labyrinth_main(name, password);
		else
		{
			printf("密码输入错误, 请重新输入密码: ");
			cin >> password;
			if (Determine(password)) Labyrinth_main(name, password);
			else
			{
				printf("密码输入错误, 请重新输入密码: ");
				cin >> password;
				if (Determine(password)) Labyrinth_main(name, password);
				else
				{
					printf("密码输入错误, 请重新输入密码(还可尝试2次): ");
					cin >> password;
					if (Determine(password)) Labyrinth_main(name, password);
					else
					{
						printf("密码输入错误, 请重新输入密码(还可尝试1次): ");
						cin >> password;
						if (Determine(password)) Labyrinth_main(name, password);
						else
						{
							system("cls");
							printf("密码锁定, 请1分钟后尝试!!!!!\n");
							for (int i = 60; i > 0; i -- )
							{
								system("cls");
								printf("密码锁定, 请1分钟后尝试!!!!!\n请在%d秒后再次尝试\n", i);
								Sleep(1000);
							}
							system("cls");
							printf("请输入密码: ");
							cin >> password;
							if (Determine(password)) Labyrinth_main(name, password);
							else
							{
								system("cls");
								printf("密码锁定, 请2分钟后尝试!!!!!\n");
								for (int i = 120; i > 0; i -- )
								{
									system("cls");
									printf("密码锁定, 请2分钟后尝试!!!!!\n");
									if (i == 60 || i == 120) printf("请在%d分钟后再次尝试\n", i / 60);
									else if (i / 60 == 0) printf("请在%d秒后再次尝试\n", i % 60);
									else printf("请在%d分%d秒后再次尝试\n", i / 60, i % 60);
									Sleep(1000);
								}
								system("cls");
								printf("请输入密码: ");
								cin >> password;
								if (Determine(password)) Labyrinth_main(name, password);
								else
								{
									system("cls");
									printf("-----------------------------------------\n");
									printf("|         密码验证失败!!!!!             |\n");
									printf("|           请联系失主!!!               |\n");
									printf("|                                       |\n");
									printf("|                                       |\n");
									printf("|                  联系电话: 18167987578|\n");
									printf("|                         琴声如瑟月徽暗|\n");
									printf("-----------------------------------------\n");
								}
							}
						}
					}
				}
			}
		}
	}
}
int main()
{
	Iinitialization(map1);
	Iinitialization(map2);
	Iinitialization(map3);
	Iinitialization(map4);
	Iinitialization(map5);
	Password();
	return 0;
}
2024/5/19 21:18
加载中...