This commit is contained in:
2024-06-22 16:30:20 +08:00
parent e4e00e8192
commit e7c056f9ba
6 changed files with 12 additions and 14 deletions

View File

@@ -37,6 +37,7 @@ void DealCards(int N, SqList<int>*& PA, SqList<int>*& PB, int times)
delete[] CardPile; // 释放发牌堆占用的内存
}
// 输出B的手牌
void DisplayPlayerBCards(int*& QB, int N)
{
for (int i = 0; i < N; i++)
@@ -45,7 +46,7 @@ void DisplayPlayerBCards(int*& QB, int N)
cout << endl;
}
bool IsPlayerBWin(int*& QB, int N)
bool IsPlayerAWin(int*& QB, int N)
{
for (int i = 0; i < N; i++)
if (QB[i] > 0) return false;
@@ -153,7 +154,7 @@ int GamePlay2(SqList<int>& PA, SqList<int>& PB, int N)
winner = 2;
break;
}
else if (IsPlayerBWin(QB, N))
else if (IsPlayerAWin(QB, N))
{
winner = 1;
break;