[SDOI2010]猪国杀

好久没写博客了,就放个毒瘤的东西吧。
这题就是纯暴力的模拟。
特判一下献殷勤和表敌意。
注意无懈可以要分是对 “谁对谁献殷勤” 使用,还是 “谁对谁表敌意” 使用的。
注意只能杀下家(这是三国杀?)
其他的打tag就好了。
善用debug,不然真的会调到吐。
代码实在太长不建议模仿。
毕竟变量名很长。

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
 
#define R register
#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define sqr(_x) ((_x) * (_x))
#pragma GCC optimize("2") //You can't see me
#define Cmax(_a, _b) ((_a) < (_b) ? (_a) = (_b), 1 : 0)
#define Cmin(_a, _b) ((_a) > (_b) ? (_a) = (_b), 1 : 0)
#define Max(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#define Min(_a, _b) ((_a) < (_b) ? (_a) : (_b))
#define Abs(_x) (_x < 0 ? (-(_x)) : (_x))
 
#ifdef DEBUG
	#define debug(a...) ((fprintf(stderr,a),fflush(stderr)))
#else
	#define debug(a...) (1)
#endif
 
using namespace std;
 
namespace Dntcry
{
	inline int read()
	{
		R int a = 0, b = 1; R char c = getchar();
		for(; c < '0' || c > '9'; c = getchar()) (c == '-') ? b = -1 : 0;
		for(; c >= '0' && c <= '9'; c = getchar()) a = (a << 1) + (a << 3) + c - '0';
		return a * b;
	}
	inline ll lread()
	{
		R ll a = 0, b = 1; R char c = getchar();
		for(; c < '0' || c > '9'; c = getchar()) (c == '-') ? b = -1 : 0;
		for(; c >= '0' && c <= '9'; c = getchar()) a = (a << 1) + (a << 3) + c - '0';
		return a * b;
	}
	const int Maxn = 11, Maxm = 2010;
	int Num_of_Player, m, Now_turned_Player, Card_Pool_Top, Now_Player_Right[Maxn], Now_Player_left[Maxn], Now_Rebel_Lives, All_Player_Still_Lives;
	char Card_Pool[Maxm], str[Maxn];
	bool Kill_used, Allegiance, JumpReverse , Majesty_Killed_aLoyal;
	struct Pig_Node
	{
		int tot, hp, id, Card_Leftest;
		char Card[Maxm << 1];
		bool susp, loyal, rebel, equip, dead;
	}P[Maxn];
	void Get_aCard(R int player)
	{	
		if(Card_Pool_Top == m)
			P[player].Card[++P[player].tot] = Card_Pool[m];
		else P[player].Card[++P[player].tot] = Card_Pool[++Card_Pool_Top];
		debug("玩家 %d 摸到了牌 %c\Num_of_Player", player, P[player].Card[ P[player].tot] ); 
	}
	void Maintenance_the_Hand(R int player)
	{
		while(P[player].Card[ P[player].Card_Leftest ] == 0 && P[player].Card_Leftest <= P[player].tot) P[player].Card_Leftest++;
	}
	void Getcard_before_Round(R int player)
	{
		for(R int i = 0; i < 2; i++) Get_aCard(player);
		return ;
	}
	int Find_SusporRebel()
	{
		for(R int i = Now_Player_Right[0]; i; i = Now_Player_Right[i])
		{
			//printf("i = %d\Num_of_Player", i);
			//printf("now = %d\Num_of_Player susp = %d\Num_of_Player", i, P[i].susp);
			if(P[i].susp || P[i].rebel) 
			{
				debug("找到第一个反贼或类反贼为 %d\Num_of_Player", i);
				return i;
			}
		}
		debug("没有找到反贼或类反贼\n"); 
		return 0;
	}
	int Find_Rebel(R int player)
	{	
		for(R int i = Now_Player_Right[player]; i != player; i = Now_Player_Right[i])
			if(P[i].rebel) 
			{
				debug("找到第一个反贼为 %d\Num_of_Player", i);
				return i;
			}
		debug("没有找到反贼\n"); 
		return 0;
	}
	int Find_Loyal(R int player)
	{	
		for(R int i = Now_Player_Right[player]; i != player; i = Now_Player_Right[i])
			if(P[i].loyal) 
			{
				debug("找到第一个忠臣为 %d\Num_of_Player", i);
				return i;
			}
		debug("没有找到忠臣\n"); 
		return 0;
	}
	bool aCard_Canornot_Play(R char card)
	{
		if(card == 0) return 0;
		if(card == 'P') 
		{
			debug("该牌为桃,体力为 %d ", P[Now_turned_Player].hp);
			if(P[Now_turned_Player].hp < 4) debug("可以使用\n");
			else debug("不能使用\n"); 
			return P[Now_turned_Player].hp < 4;
		}
		if(card == 'K')
		{
			debug("该牌为杀\n"); 
			if(Kill_used && !P[Now_turned_Player].equip) 
			{
				debug("本回合已使用杀,且未装备连弩,无法继续使用杀\n"); 
				return 0;
			}
			if(Now_turned_Player == 0)
			{
				if(P[ Now_Player_Right[Now_turned_Player] ].susp || P[ Now_Player_Right[Now_turned_Player] ].rebel) return 1;
				return 0;
			}
			if(P[Now_turned_Player].id == 1)
			{
				if(P[ Now_Player_Right[Now_turned_Player] ].rebel) return 1;
				return 0;
			}
			if(Now_Player_Right[Now_turned_Player] == 0) return 1;
			if(P[ Now_Player_Right[Now_turned_Player] ].loyal) return 1;
			return 0;
		}
		if(card == 'D' || card == 'J') 
		{
			debug("该牌为闪或无懈可击,无法主动出牌\n");
			return 0;
		} 
		if(card == 'F') 
		{
			debug("该牌为决斗\n");
			if(Now_turned_Player == 0)
			{
				R int tmp = Find_SusporRebel();
				//puts("susp:");
				//for(R int i = 0; i < Num_of_Player; i++) printf("%d ", P[i].susp);
				//printf("tmp = %d\Num_of_Player", tmp);
				if(tmp) return 1;
				//puts("down");
				return 0;
			}
			if(P[Now_turned_Player].id == 1)
			{
				if(Find_Rebel(Now_turned_Player)) return 1;
				return 0;
			}
			return 1;
		}
		if(card == 'N' || card == 'W') 
		{
			debug("该牌为南蛮入侵或万箭齐发\n"); 
			return 1;
		}
		if(card == 'Z') 
		{
			debug("该牌为诸葛连弩\n");
			return 1;
		}
	}
	void Save(R int player)
	{
		debug("玩家 %d 开始自救\n", player);
		for(R int i = P[player].Card_Leftest; i <= P[player].tot; i++)
		{
			if(P[player].Card[i] == 'P') 
			{
				P[player].hp++;
				debug("玩家 %d 使用桃 HP=%d\Num_of_Player", player, P[player].hp);
				P[player].Card[i] = 0;
				Maintenance_the_Hand(player);
			}
			if(P[player].hp) return ;
		}
		return ;
	}
	void Majesty_Fold(R int player)
	{
		P[player].Card[ P[player].tot ] = 0;
		P[player].Card_Leftest = P[player].tot + 1;
		P[player].equip = 0;
	}
	void Debug_ShowitCard(R int player)
	{
		//for(R int i = P[player].Card_Leftest; i <= P[player].tot; i++) if(P[player].Card[i] != 0) debug("%c ", P[player].Card[i]);
		debug("\n");
	}
	void Draw_the_Answer(R int player)
	{
		for(R int i = P[player].Card_Leftest; i <= P[player].tot; i++)
			if(P[player].Card[i] != 0) putchar(P[player].Card[i]), putchar(' ');
		putchar('\n');
	}
	void Draw()
	{
		for(R int i = 0; i < Num_of_Player; i++)
			if(P[i].dead) puts("DEAD");
			else Draw_the_Answer(i);
	}
	void A_Player_Die(R int recieve, R int from)
	{
		//printf("player %d die\Num_of_Player", recieve);
		debug("玩家 %d 被 玩家 %d 杀死\n", recieve, from);
		debug("玩家 %d 的身份是 %d\Num_of_Player", recieve, P[recieve].id);
		Now_Player_Right[ Now_Player_left[recieve] ] = Now_Player_Right[recieve];
		Now_Player_left[ Now_Player_Right[recieve] ] = Now_Player_left[recieve];
		P[recieve].dead = 1;
		--All_Player_Still_Lives;
		if(P[recieve].id == 2) Now_Rebel_Lives--;
		if(recieve == 0) 
		{ 
			///*Kry*/puts("主公死亡 反贼胜利"); 
			puts("FP"); Draw(); exit(0); 
		}
		if(!Now_Rebel_Lives) 
		{ 
			///*Kry*/puts("反贼全部死亡 主公胜利"); 
			puts("MP"); Draw(); exit(0); 
		}
		if(P[recieve].id == 1 && from == 0) 
		{ 
			Majesty_Killed_aLoyal = 1;
			///*Kry*/puts("主公杀死忠臣,弃置所有手牌"); 
			Majesty_Fold(from); 
			///*Kry*/puts("主公的手牌为:");
			 Debug_ShowitCard(0);
		} 
		if(P[recieve].id == 2) 
		{ 
			///*Kry*/puts("反贼死亡 伤害来源摸三张牌"); 
			Get_aCard(from), Get_aCard(from), Get_aCard(from); 
		}
	}
	void Got_kill(R int recieve, R int from)
	{	
		debug("玩家 %d 对玩家 %d 使用了一张杀\n", from, recieve);
		for(R int i = P[recieve].Card_Leftest; i <= P[recieve].tot; i++)
			if(P[recieve].Card[i] == 'D') 
			{
				debug("玩家 %d 使用一张闪\n", recieve);
				P[recieve].Card[i] = 0;
				Maintenance_the_Hand(recieve);
				return ;
			}
		debug("玩家 %d HP-1\Num_of_Player", recieve);
		if(!(--P[recieve].hp))
		{
			debug("玩家 %d 进入濒死阶段\n", recieve);
		 	Save(recieve);
			if(!P[recieve].hp) A_Player_Die(recieve, from);
		}
	}
	int Find_kill(R int recieve)
	{
		for(R int i = P[recieve].Card_Leftest; i <= P[recieve].tot; i++)
			if(P[recieve].Card[i] == 'K') 
				return i;
		return 0;
	}
	int Find_dodge(R int recieve)
	{
		for(R int i = P[recieve].Card_Leftest; i <= P[recieve].tot; i++)
			if(P[recieve].Card[i] == 'D') 
				return i;
		return 0;
	}
	bool Court(R int recieve, R int from, R int flag)
	{
		//printf("fr = %d\Num_of_Player", from);
		//for(R int i = 0; i < Num_of_Player; i++) printf("%d ", Now_Player_Right[i]);
		for(R int i = from, t = 1; t <= All_Player_Still_Lives; t++, i = Now_Player_Right[i])
		{
			//printf("now = %d\Num_of_Player", i);
			if(!flag)
			{
				if(P[i].id == 1 && (P[recieve].loyal || recieve == 0))
				{
					for(R int j = P[i].Card_Leftest; j <= P[i].tot; j++)
						if(P[i].Card[j] == 'J')
						{
							P[i].loyal = 1;
							Allegiance = 1;
							P[i].susp = 0;
							P[i].Card[j] = 0;
							debug("玩家 %d 跳忠\n", i);
							Maintenance_the_Hand(i);
							debug("玩家 %d 对玩家 %d 使用无懈可击\n", i, from);
							debug("用于无懈他对 %d 的表敌意\n", recieve);
							if(Court(from, i, 1)) return 0;
							else 
							{
								//printf("loyal %d\Num_of_Player", i);
								return 1;
							}
						}
				}
				if(P[i].id == 2 && (P[recieve].rebel))
				{
					for(R int j = P[i].Card_Leftest; j <= P[i].tot; j++)
						if(P[i].Card[j] == 'J')
						{
							P[i].rebel = 1;
							JumpReverse  = 1;
							P[i].susp = 0;
							P[i].Card[j] = 0;
							debug("玩家 %d 跳反\n", i);
							Maintenance_the_Hand(i);
							debug("玩家 %d 对玩家 %d 使用无懈可击\n", i, from);
							debug("用于无懈他对 %d 的表敌意\n", recieve);
							if(Court(from, i, 1)) return 0;
							else 
							{
								//printf("rebel %d\Num_of_Player", i);
								return 1;
							}
						}
				}
				if(i == 0 && (P[recieve].loyal || recieve == 0))
				{
					for(R int j = P[i].Card_Leftest; j <= P[i].tot; j++)
						if(P[i].Card[j] == 'J')
						{
							P[i].Card[j] = 0;
							Maintenance_the_Hand(i);
							debug("玩家 %d 对玩家 %d 使用无懈可击\n", i, from);
							debug("用于无懈他对 %d 的表敌意\n", recieve);
							if(Court(from, i, 1)) return 0;
							else 
							{
								//printf("master\Num_of_Player");
								return 1;
							}
						}
				}
			}
			else
			{
				if(P[i].id == 1 && (P[from].rebel))
				{
					for(R int j = P[i].Card_Leftest; j <= P[i].tot; j++)
						if(P[i].Card[j] == 'J')
						{
							P[i].loyal = 1;
							Allegiance = 1;
							P[i].susp = 0;
							P[i].Card[j] = 0;
							debug("玩家 %d 跳忠\n", i);
							Maintenance_the_Hand(i);
							debug("玩家 %d 对玩家 %d 使用无懈可击\n", i, from);
							debug("用于无懈他对 %d 的献殷勤\n", recieve);
							if(Court(from, i, 0)) return 0;
							else 
							{
								//printf("loyal %d\Num_of_Player", i);
								return 1;
							}
						}
				}
				if(P[i].id == 2 && (P[from].loyal || from == 0))
				{
					for(R int j = P[i].Card_Leftest; j <= P[i].tot; j++)
						if(P[i].Card[j] == 'J')
						{
							P[i].rebel = 1;
							JumpReverse  = 1;
							P[i].susp = 0;
							P[i].Card[j] = 0;
							debug("玩家 %d 跳反\n", i);
							Maintenance_the_Hand(i);
							debug("玩家 %d 对玩家 %d 使用无懈可击\n", i, from);
							debug("用于无懈他对 %d 的献殷勤\n", recieve);
							if(Court(from, i, 0)) return 0;
							else 
							{
								//printf("rebel %d\Num_of_Player", i);
								return 1;
							}
						}
				}
				if(i == 0 && P[from].rebel)
				{
					for(R int j = P[i].Card_Leftest; j <= P[i].tot; j++)
						if(P[i].Card[j] == 'J')
						{
							P[i].Card[j] = 0;
							Maintenance_the_Hand(i);
							debug("玩家 %d 对玩家 %d 使用无懈可击\n", i, from);
							debug("用于无懈他对 %d 的献殷勤\n", recieve);
							if(Court(from, i, 0)) return 0;
							else 
							{
								//printf("master\Num_of_Player");
								return 1;
							}
						}
				}
			}
		}
		return 0;
	}
	void Fight(R int recieve, R int from)
	{
		debug("玩家 %d 对玩家 %d 发起决斗\n", from, recieve);
		if(Court(recieve, from, 0)) return ;
		//puts("down");
		if(P[recieve].id == 1 && from == 0)
		{
			debug("玩家 %d HP - 1\Num_of_Player", recieve);
			if(!(--P[recieve].hp))
			{
				debug("玩家 %d 进入濒死阶段\n", recieve);
			 	Save(recieve);
				if(!P[recieve].hp) A_Player_Die(recieve, from);
			}
			//printf("person %d sups\Num_of_Player", P[recieve].susp);
			return ;
		}
		for(R int opt = 0; ; opt ^= 1)
		{
			R int tmp = Find_kill((!opt) ? recieve : from);
			if(!tmp) 
			{
				debug("玩家 %d HP - 1\Num_of_Player", ((!opt) ? recieve : from));
				if(!(--P[((!opt) ? recieve : from)].hp))
				{
					debug("玩家 %d 进入濒死阶段\n", ((!opt) ? recieve : from));
				 	Save((!opt) ? recieve : from);
					if(!P[((!opt) ? recieve : from)].hp) A_Player_Die(((!opt) ? recieve : from), ((!opt) ? from : recieve));
				}
				return ;
			}
			debug("玩家 %d 对玩家 %d 出了一张杀\n", ((!opt) ? recieve : from), ((!opt) ? from : recieve));
			if(((!opt) ? from : recieve) == 0)
			{
				debug("玩家 %d 跳反\n", ((!opt) ? recieve : from));
				P[((!opt) ? recieve : from)].rebel = 1;
				JumpReverse  = 1;
				P[((!opt) ? recieve : from)].susp = 0;
			}
			P[((!opt) ? recieve : from)].Card[tmp] = 0;
			Maintenance_the_Hand((!opt) ? recieve : from);
		}
	}
	void Barbarian_Breakout(R int recieve)
	{
		debug("玩家 %d 发起南蛮入侵\n", recieve);
		for(R int i = Now_Player_Right[recieve]; i != recieve; i = Now_Player_Right[i])
		{
			//puts("Down");
			if(Court(i, recieve, 0)) continue;
			R int tmp = Find_kill(i);
			if(!tmp)
			{
				debug("玩家 %d HP -1\Num_of_Player", i);
				if(!(--P[i].hp))
				{
					debug("玩家 %d 进入濒死阶段\n", i);
					Save(i);
					if(!P[i].hp) A_Player_Die(i, recieve);
				}
				if(i == 0 && !P[recieve].rebel && !P[recieve].loyal) 
				{
					debug("玩家 %d 被认为是类反贼\n", recieve);
					P[recieve].susp = 1; 
				}
				continue ;
			}
			debug("玩家 %d 打出一张杀\n", i);
			P[i].Card[tmp] = 0;
			Maintenance_the_Hand(i);
		}
	}
	void Rain_of_Arrows(R int recieve)
	{
		debug("玩家 %d 发起万箭齐发\n", recieve);
		for(R int i = Now_Player_Right[recieve]; i != recieve; i = Now_Player_Right[i])
		{
			if(Court(i, recieve, 0)) continue;
			R int tmp = Find_dodge(i);
			if(!tmp)
			{
				debug("玩家 %d HP -1\Num_of_Player", i);
				if(!(--P[i].hp))
				{
					debug("玩家 %d 进入濒死阶段\n", i);
					Save(i);
					if(!P[i].hp) A_Player_Die(i, recieve);
				}
				if(i == 0 && !P[recieve].rebel && !P[recieve].loyal) 
				{
					debug("玩家 %d 被认为是类反贼\n", recieve);
				 	P[recieve].susp = 1; 
				}
				continue ;
			}
			debug("玩家 %d 打出一张闪\n", i);
			P[i].Card[tmp] = 0;
			Maintenance_the_Hand(i);
		}
	}
	void Play_aCard(R char recieve)
	{
		if(recieve == 'P') 
		{ 
			debug("玩家 %d 使用桃 HP+1\Num_of_Player", Now_turned_Player);
			P[Now_turned_Player].hp++; 
			return ;
		}
		if(recieve == 'K')
		{
			Kill_used = 1;
			if(Now_turned_Player == 0) 
			{
				if(P[ Now_Player_Right[Now_turned_Player] ].susp || P[ Now_Player_Right[Now_turned_Player] ].rebel) 
					Got_kill(Now_Player_Right[Now_turned_Player], Now_turned_Player);
				return ;
			}
			if(P[Now_turned_Player].id == 1)
			{
				if(P[ Now_Player_Right[Now_turned_Player] ].rebel) 
				{
					debug("玩家 %d 被认为是忠臣\n", Now_turned_Player);
					 P[Now_turned_Player].susp = 0, P[Now_turned_Player].loyal = 1;
					 Allegiance = 1;
					 Got_kill(Now_Player_Right[Now_turned_Player], Now_turned_Player);
					return ;
				}
				return ;
			}
			if(Now_Player_Right[Now_turned_Player] == 0) 
			{
				P[Now_turned_Player].rebel = 1;
				JumpReverse  = 1;
				P[Now_turned_Player].susp = 0;
				debug("玩家 %d 被认为是反贼\n", Now_turned_Player);
				Got_kill(Now_Player_Right[Now_turned_Player], Now_turned_Player);
				return ;
			}
			if(P[ Now_Player_Right[Now_turned_Player] ].loyal) 
			{
				P[Now_turned_Player].rebel = 1;
				JumpReverse  = 1;
				P[Now_turned_Player].susp = 0;
				debug("玩家 %d 被认为是反贼\n", Now_turned_Player);
				Got_kill(Now_Player_Right[Now_turned_Player], Now_turned_Player);
				return ;
			}
		}
		if(recieve == 'F') 
		{
			if(Now_turned_Player == 0)
			{
				R int obj = Find_SusporRebel();
				//printf("tmp = %d\Num_of_Player", obj);
				Fight(obj, Now_turned_Player);
				return ;
			}
			if(P[Now_turned_Player].id == 1)
			{
				R int obj = Find_Rebel(Now_turned_Player);
				P[Now_turned_Player].loyal = 1;
				Allegiance = 1;
				P[Now_turned_Player].susp = 0;
				debug("玩家 %d 被认为是忠臣\n", Now_turned_Player);
				Fight(obj, Now_turned_Player);
				return ;
			}
			P[Now_turned_Player].rebel = 1;
			JumpReverse  = 1;
			P[Now_turned_Player].susp = 0;
			debug("玩家 %d 被认为是反贼\n", Now_turned_Player);
			Fight(0, Now_turned_Player);
			return ;
		}
		if(recieve == 'Z') {  P[Now_turned_Player].equip = 1; return ; }
		if(recieve == 'N') Barbarian_Breakout(Now_turned_Player);
		if(recieve == 'W') Rain_of_Arrows(Now_turned_Player);
	}
	int Main()
	{
		freopen("1.in", "r", stdin);
		//freopen("1.out", "w", stdout);
		All_Player_Still_Lives = Num_of_Player = read(), m = read();
		for(R int i = 0; i < Num_of_Player; i++)
		{
			scanf("%s", str);
			if(str[0] == 'Z') P[i].id = 1;
			else if(str[0] == 'F') P[i].id = 2, Now_Rebel_Lives++;
			P[i].hp = 4;
			P[i].Card_Leftest = 1;
			for(R int j = 0; j < 4; j++)
				scanf("%s", str), P[i].Card[++P[i].tot] = str[0];
		}
		for(R int i = 0; i < Num_of_Player; i++) Now_Player_left[i] = i - 1, Now_Player_Right[i] = i + 1;
		Now_Player_left[0] = Num_of_Player - 1, Now_Player_Right[Num_of_Player - 1] = 0;
		for(R int i = 1; i <= m; i++)
			scanf("%s", str), Card_Pool[i] = str[0];
		//for(R int i = 0; i < Num_of_Player; i++) printf("r = %d ", Now_Player_Right[i]);cout<
		for(R int t = 1; ; t++, Now_turned_Player = Now_Player_Right[Now_turned_Player])
		{
			//printf("time = %d\Num_of_Player", t);
			//printf("Now_turned_Player = %d\Num_of_Player", Now_turned_Player);
			debug("--------------------\nROUND %d\Num_of_Player--------------------\n", t);
			debug("现在是 %d 的回合,他的身份是 %d。\n", Now_turned_Player, P[Now_turned_Player].id);
			debug("本轮开始前,所有人的手牌为:\n");
			//for(R int i = 0; i < Num_of_Player; i++) if(P[i].dead) debug("DEAD\Num_of_Player"); else Debug_ShowitCard(i); 
			Majesty_Killed_aLoyal = 0;
			Allegiance = 0;
			JumpReverse  = 0;
			Kill_used = 0;
			Getcard_before_Round(Now_turned_Player);
			Maintenance_the_Hand(Now_turned_Player);
			debug("摸牌后他的手牌是:");
			Debug_ShowitCard(Now_turned_Player);
			///*Kry*/for(R int i = P[Now_turned_Player].Card_Leftest; i <= P[Now_turned_Player].tot; i++) if(P[Now_turned_Player].Card[i]) putchar(P[Now_turned_Player].Card[i]), putchar(' ');
			///*Kry*/putchar('\n'); 
			//for(R int i = P[Now_turned_Player].Card_Leftest; i <= P[Now_turned_Player].tot; i++) if(P[Now_turned_Player].Card[i]) printf("%c ", P[Now_turned_Player].Card[i]); cout<
			//printf("l = %d r = %d\Num_of_Player", P[Now_turned_Player].Card_Leftest, P[Now_turned_Player].tot);
			for(R int i = P[Now_turned_Player].Card_Leftest; i <= P[Now_turned_Player].tot; i++)
			{
				if(Majesty_Killed_aLoyal) break;
				if(P[Now_turned_Player].dead) break;
				//printf("nowat %c\Num_of_Player", P[Now_turned_Player].Card[i]);
				///puts("hp:");
				//for(R int i = 0; i < Num_of_Player; i++) printf("%d ", P[i].hp); cout<
				if(aCard_Canornot_Play(P[Now_turned_Player].Card[i])) 
				{
					//printf("i = %d\Num_of_Player", i);
					//printf("nowcard = %c\Num_of_Player", P[Now_turned_Player].Card[i]);
					R char nowcard = P[Now_turned_Player].Card[i];
					P[Now_turned_Player].Card[i] = 0;
					Maintenance_the_Hand(Now_turned_Player);
					Play_aCard(nowcard);
					//puts("down");
					if(nowcard == 'Z') 
					{
						i = P[Now_turned_Player].Card_Leftest - 1;
						debug("装备连弩,重新搜索是否有杀\n"); 
						//printf("Card_Leftest = %d\Num_of_Player", P[Now_turned_Player].Card_Leftest);
					}
				}
				else if(P[Now_turned_Player].Card[i]) debug("该牌不可出\n"); 
					//puts("down");
				if(P[Now_turned_Player].id == 1 && JumpReverse ) JumpReverse  = 0, i = P[Now_turned_Player].Card_Leftest - 1;
				if(P[Now_turned_Player].id == 2 && Allegiance) Allegiance = 0, i = P[Now_turned_Player].Card_Leftest - 1;
				
			}
			debug("本轮结束前,所有人的手牌为:\n");
			//for(R int i = 0; i < Num_of_Player; i++) if(P[i].dead) debug("DEAD\Num_of_Player"); else Debug_ShowitCard(i); 
			//debug("回合结束剩余手牌为:");
			/////*Kry*/for(R int i = P[Now_turned_Player].Card_Leftest; i <= P[Now_turned_Player].tot; i++) if(P[Now_turned_Player].Card[i]) putchar(P[Now_turned_Player].Card[i]), putchar(' ');
			/////*Kry*/putchar('\n'); 
			debug("\n"); 
			//printf("l = %d r = %d\Num_of_Player", P[Now_turned_Player].Card_Leftest, P[Now_turned_Player].tot);
			//for(R int i = 0; i < Num_of_Player; i++) printf("%d ", P[i].susp); cout<
		}
		return 0;
	}
}
int main()
{
	return Dntcry :: Main();
}

你可能感兴趣的:(模拟)