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,8 +94,8 @@ Begin:
int pass_num = 0;
int round = 1;
int finish_num = 0;
printf("发牌完成,选择你的操作:\n");
while (finish_num < 2&&round<54)
printf("发牌完成,选择你的操作:\n");
while (finish_num < 2 && round < 54)
{
if (pass_num > 3 - finish_num)
@ -131,12 +136,14 @@ Begin:
printf("댄轎渴흙\n");
goto A;
}
std::cout << "打出" << PU[l.firstInsert((p1).remove(opt))];
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());
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());
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

@ -10,14 +10,14 @@ public:
{
_size = i;
_s = new int[_size - 1];
for(int i=0;i<_size;i++)
for (int i = 0; i < _size; i++)
{
_s[i]=0;
_s[i] = 0;
}
}
void finish(int t)
{
_s[t] = 3 - (time++);
_s[t] = 3 - 1 - (time++);
}
bool isFinish(int i)
{