6似乎是没bug了

This commit is contained in:
iridiumR 2021-10-28 19:30:56 +08:00
parent 000670f603
commit 442a76e226
2 changed files with 34 additions and 25 deletions

View file

@ -63,7 +63,7 @@ Begin:
xipai_flag == 0;
goto Begin;
}
printf("===============开始发牌===============\n");
printf("================开始发牌================\n");
List p1, p2, p3;
for (int i = 0; i <= 53; i++)
{
@ -80,6 +80,11 @@ Begin:
break;
}
}
printf("你手中的牌:\n");
for (int i = 0; i < p1.getSize(); i++)
{
std::cout << i << ": " << PU[(p1)[i]] << "\n";
}
l.clear();
p1.sort();
p2.sort();
@ -89,7 +94,7 @@ Begin:
int pass_num = 0;
int round = 1;
int finish_num = 0;
printf("发牌完成,选择你的操作:\n");
printf("发牌完成,选择你的操作:\n");
while (finish_num < 2 && round < 54)
{
@ -131,12 +136,14 @@ Begin:
printf("错误输入\n");
goto A;
}
if (p1[1])
std::cout << "打出" << PU[l.firstInsert((p1).remove(opt))];
if (int size = p1.getSize() == 0)
{
s.finish(0);
printf(",玩家A出完所有牌\n");
finish_num++;
pass_num = 0;
}
else
printf(",剩余%d张牌\n", p1.getSize());
@ -160,7 +167,7 @@ Begin:
B:
if (p2.getSize())
{
printf("================================\n");
printf("--------------------\n");
printf("B玩家");
if (pass_num == 2 - finish_num)
@ -181,24 +188,25 @@ Begin:
if (l[0] < p2[i])
{
std::cout << "打出" << PU[l.firstInsert((p2).remove(i))];
if (int size = p2.getSize() == 0)
{
s.finish(1);
printf(",玩家B出完所有牌\n");
finish_num++;
}
else
printf(",剩余%d张牌\n", p2.getSize());
break;
}
}
if (p2.getSize() == 0)
{
s.finish(1);
printf("玩家B出完所有牌\n");
finish_num++;
pass_num = 0;
}
}
else
printf("玩家B轮空\n");
C:
if (p3.getSize())
{
printf("================================\n");
printf("--------------------\n");
printf("C玩家");
if (pass_num == 2 - finish_num)
@ -219,17 +227,18 @@ Begin:
if (l[0] < p3[i])
{
std::cout << "打出" << PU[l.firstInsert((p3).remove(i))];
if (int size = p3.getSize() == 0)
{
s.finish(2);
printf(",玩家C出完所有牌\n");
finish_num++;
}
else
printf(",剩余%d张牌\n", p3.getSize());
break;
}
}
if (p3.getSize() == 0)
{
s.finish(2);
printf("玩家C出完所有牌\n");
finish_num++;
pass_num = 0;
}
}
else
printf("玩家C轮空\n");

View file

@ -17,7 +17,7 @@ public:
}
void finish(int t)
{
_s[t] = 3 - (time++);
_s[t] = 3 - 1 - (time++);
}
bool isFinish(int i)
{