We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f53a6d4 commit 9742850Copy full SHA for 9742850
SOLUTIONS/Exercise 10.1.2/CardGameGUI/blackjack.cpp
@@ -64,6 +64,11 @@ void BlackJack::dealHand()
64
dealerHand = nullptr;
65
}
66
67
+ if(deck->count() <= 4) {
68
+ qDebug() << "insufficient amount of cards...";
69
+ shuffleDeck();
70
+ }
71
+
72
playerHand = deck->deal(2);
73
dealerHand = deck->deal(2);
74
@@ -84,6 +89,10 @@ void BlackJack::shuffleDeck()
84
89
85
90
void BlackJack::hitMe()
86
91
{
92
+ if(deck->count() <= 1) {
93
94
95
87
96
qDebug() << "Adding card...";
88
97
playerHand->append(deck->last());
98
deck->removeLast();
0 commit comments