|
@@ -4,6 +4,7 @@ import io.zipcoder.casino.CardGame.Card;
|
4
|
4
|
import io.zipcoder.casino.CardGame.CardGame;
|
5
|
5
|
import io.zipcoder.casino.CardGame.Deck;
|
6
|
6
|
import io.zipcoder.casino.CardGame.Face;
|
|
7
|
+import io.zipcoder.casino.Casino_test;
|
7
|
8
|
import io.zipcoder.casino.Interfaces.Gamble;
|
8
|
9
|
import io.zipcoder.casino.Player;
|
9
|
10
|
|
|
@@ -19,35 +20,33 @@ public class BlackJack extends CardGame implements Gamble {
|
19
|
20
|
private boolean justDealt = false;
|
20
|
21
|
private int numOfTurns = 0;
|
21
|
22
|
private BlackJackPlayer dealer = new BlackJackPlayer(new Dealer());
|
|
23
|
+ int stands = 0;
|
22
|
24
|
|
23
|
25
|
|
24
|
26
|
public BlackJack(Player player) {
|
25
|
27
|
BlackJackPlayer blackJackPlayer = new BlackJackPlayer(player);
|
26
|
28
|
blackJackPlayers.add(dealer);
|
27
|
29
|
this.blackJackPlayers.add(blackJackPlayer);
|
|
30
|
+ deck.shuffle();
|
28
|
31
|
}
|
29
|
32
|
|
30
|
33
|
public void hit(BlackJackPlayer player) {
|
31
|
34
|
setJustDealt(false);
|
32
|
35
|
Card card = deck.draw();
|
33
|
36
|
player.addToHand(card);
|
|
37
|
+ countPlayerHand(player);
|
34
|
38
|
|
35
|
|
- if (countPlayerHand(player).get(0) > 21 || (countPlayerHand(player).size() == 2 && countPlayerHand(player).get(1) > 21)) {
|
36
|
|
- System.out.println("Your Current Hand: \n" + formatHand(player.getPlayerHand()) + "\nHand Value: " + formatHandValue(countPlayerHand(player)) + "\nToo high, you lose!");
|
37
|
|
- } else {
|
38
|
|
- System.out.println("Your Current Hand: \n" + formatHand(player.getPlayerHand()) + "\nHand Value: " + formatHandValue(countPlayerHand(player)));
|
|
39
|
+
|
|
40
|
+ if (player == blackJackPlayers.get(1)) {
|
|
41
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYou Hit: " + card.toString());
|
|
42
|
+ } else if (player == this.dealer) {
|
|
43
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDealer Hit: " + card.toString());
|
39
|
44
|
}
|
40
|
|
- }
|
41
|
45
|
|
42
|
|
-// public void flip() {
|
43
|
|
-// // shoulder technically be card.setCovered(false); or something like that
|
44
|
|
-// boolean covered = false;
|
45
|
|
-// }
|
|
46
|
+ }
|
46
|
47
|
|
47
|
48
|
public void split(BlackJackPlayer player) {
|
48
|
49
|
|
49
|
|
- System.out.println(player.getPlayerHand() + "\n");
|
50
|
|
-
|
51
|
50
|
Card movingCard = player.getPlayerHand().get(1);
|
52
|
51
|
|
53
|
52
|
if (justDealt && player.getPlayerHand().get(0).getFace() == player.getPlayerHand().get(1).getFace()) {
|
|
@@ -56,14 +55,11 @@ public class BlackJack extends CardGame implements Gamble {
|
56
|
55
|
player.getPlayerHand().remove(movingCard);
|
57
|
56
|
}
|
58
|
57
|
|
59
|
|
- System.out.println(player.getPlayerHand() + " " + player.getSecondHand());
|
60
|
58
|
setJustDealt(false);
|
61
|
|
-
|
62
|
|
- // must be the same card value
|
63
|
59
|
}
|
64
|
60
|
|
65
|
61
|
public void doubleDown(BlackJackPlayer blackJackPlayer) {
|
66
|
|
- if (getJustDealt() == true) {
|
|
62
|
+ if (getJustDealt()) {
|
67
|
63
|
blackJackPlayer.addToBetPot(blackJackPlayer.getInitialBet());
|
68
|
64
|
}
|
69
|
65
|
|
|
@@ -72,8 +68,8 @@ public class BlackJack extends CardGame implements Gamble {
|
72
|
68
|
}
|
73
|
69
|
|
74
|
70
|
public void stand() {
|
75
|
|
- endTurn();
|
76
|
|
- // (end turn?) what does "take a turn" actually initiate
|
|
71
|
+ setJustDealt(false);
|
|
72
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nStanding still!");
|
77
|
73
|
}
|
78
|
74
|
|
79
|
75
|
public int calculate_AceIsOne(BlackJackPlayer player) {
|
|
@@ -132,18 +128,15 @@ public class BlackJack extends CardGame implements Gamble {
|
132
|
128
|
}
|
133
|
129
|
|
134
|
130
|
public void deal() {
|
135
|
|
- deck.shuffle();
|
136
|
131
|
|
137
|
132
|
for (int i = 0; i < 2; i++) {
|
138
|
133
|
for (BlackJackPlayer player : this.blackJackPlayers) {
|
139
|
134
|
Card card = deck.draw();
|
140
|
135
|
player.addToHand(card);
|
|
136
|
+ countPlayerHand(player);
|
141
|
137
|
}
|
142
|
138
|
}
|
143
|
139
|
|
144
|
|
- System.out.println("Your Current Hand: \n" + formatHand(this.blackJackPlayers.get(1).getPlayerHand()) + "\nHand Value: " + formatHandValue(countPlayerHand(this.blackJackPlayers.get(1))) + "\n");
|
145
|
|
- System.out.println("Dealer's Current Hand: \nMYSTERY-CARD || " + formatHand(dealer.getDealerHand()) + "\nHand Value: ??" + "\n");
|
146
|
|
-
|
147
|
140
|
setJustDealt(true);
|
148
|
141
|
}
|
149
|
142
|
|
|
@@ -152,25 +145,211 @@ public class BlackJack extends CardGame implements Gamble {
|
152
|
145
|
}
|
153
|
146
|
|
154
|
147
|
public BlackJackPlayer getDealer() {
|
155
|
|
- return dealer;
|
|
148
|
+ return this.dealer;
|
156
|
149
|
}
|
157
|
150
|
|
158
|
151
|
public void start() {
|
159
|
|
- Scanner reader = new Scanner(System.in);
|
160
|
|
- System.out.println("Enter an initial bet: ");
|
161
|
|
- int initialBet = reader.nextInt();
|
162
|
|
-
|
|
152
|
+ Scanner scanner = new Scanner(System.in);
|
|
153
|
+ Casino_test instance = Casino_test.getInstance();
|
|
154
|
+ // System.out.println("\nWould you like the hear the rules of the game?\n<< Yes - No - Quit >>");
|
|
155
|
+ // String userInput = scanner.nextLine();
|
|
156
|
+ int initialBet;
|
|
157
|
+ // String input = userInput.toUpperCase();
|
|
158
|
+
|
|
159
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nHow much would you like to bet?");
|
|
160
|
+ initialBet = scanner.nextInt();
|
163
|
161
|
start(initialBet);
|
|
162
|
+
|
|
163
|
+// switch (input) {
|
|
164
|
+// case "YES":
|
|
165
|
+// System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nGoogle. Okay, let's begin!\n\nHow much would you like to bet?");
|
|
166
|
+// initialBet = scanner.nextInt();
|
|
167
|
+// start(initialBet);
|
|
168
|
+// break;
|
|
169
|
+// case "NO":
|
|
170
|
+// System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nOkay, let's begin!\n\nHow much would you like to bet?");
|
|
171
|
+// initialBet = scanner.nextInt();
|
|
172
|
+// start(initialBet);
|
|
173
|
+// break;
|
|
174
|
+// case "QUIT":
|
|
175
|
+// System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nk bye felicia");
|
|
176
|
+// // go back to casino??
|
|
177
|
+// break;
|
|
178
|
+// default:
|
|
179
|
+// System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nPlease try again.");
|
|
180
|
+// start();
|
|
181
|
+// break;
|
|
182
|
+// }
|
164
|
183
|
}
|
165
|
184
|
|
166
|
185
|
public void start(int initialBet) {
|
167
|
|
- // upon starting a new game, every player places a bet? make a loop???
|
168
|
|
- BlackJackPlayer blackJackPlayer = blackJackPlayers.get(0);
|
|
186
|
+ Casino_test instance = Casino_test.getInstance();
|
|
187
|
+ BlackJackPlayer blackJackPlayer = blackJackPlayers.get(1);
|
|
188
|
+
|
169
|
189
|
if (initialBet < minBet) {
|
170
|
|
- System.out.println("TOo low");
|
|
190
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nThe minimum bet is $50. Please try again.");
|
|
191
|
+ start();
|
171
|
192
|
} else {
|
172
|
|
- blackJackPlayer.setInitialBet(betAmount(initialBet, blackJackPlayers.get(0)));
|
|
193
|
+ blackJackPlayer.setInitialBet(betAmount(initialBet, blackJackPlayers.get(1)));
|
|
194
|
+ }
|
|
195
|
+
|
|
196
|
+ // Player player = new Player("Theta Thunder the III");
|
|
197
|
+ Scanner scanner = new Scanner(System.in);
|
|
198
|
+
|
|
199
|
+ // BlackJack blackJack = new BlackJack(player);
|
|
200
|
+
|
|
201
|
+ // BlackJackPlayer blackJackPlayer = blackJack.getPlayer(1);
|
|
202
|
+ // BlackJackPlayer dealer = blackJack.getDealer();
|
|
203
|
+
|
|
204
|
+ BlackJackPlayer activePlayer;
|
|
205
|
+//
|
|
206
|
+// System.out.println("\nWelcome to BlackJack!\n\nThe minimum bet is $50.");
|
|
207
|
+// blackJack.start();
|
|
208
|
+
|
|
209
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nGAME START - DEALING CARDS test player name" + blackJackPlayer.getPlayer().getName());
|
|
210
|
+ deal();
|
|
211
|
+
|
|
212
|
+ int turnNumber = getNumOfTurns();
|
|
213
|
+ int stands = getStands();
|
|
214
|
+
|
|
215
|
+ boolean flag = true;
|
|
216
|
+
|
|
217
|
+ while (flag) {
|
|
218
|
+ if (turnNumber % 2 == 1) {
|
|
219
|
+ activePlayer = this.dealer;
|
|
220
|
+ } else {
|
|
221
|
+ activePlayer = blackJackPlayer;
|
|
222
|
+ }
|
|
223
|
+
|
|
224
|
+ ArrayList<Integer> handValue = countPlayerHand(activePlayer);
|
|
225
|
+
|
|
226
|
+ if (turnNumber == 0 && this.dealer.getHandValue() == 21) {
|
|
227
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDealer's Current Hand: \n\n" + formatHand(this.dealer.getPlayerHand()) + "\n\nDealer's Hand Value: " + this.dealer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nBlackjack! Dealer wins!");
|
|
228
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() - (blackJackPlayer.getBetPot() * 2));
|
|
229
|
+ System.out.println("\nYou Lost $" + blackJackPlayer.getBetPot() * 2 + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
230
|
+ flag = false;
|
|
231
|
+ } else if (turnNumber == 0 && blackJackPlayer.getHandValue() == 21) {
|
|
232
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Current Hand: \n\n" + formatHand(blackJackPlayer.getPlayerHand()) + "\n\nYour Hand Value: " + blackJackPlayer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nBlackjack! Player wins!");
|
|
233
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() + (blackJackPlayer.getBetPot() * 2));
|
|
234
|
+ System.out.println("\nYou Won: $" + blackJackPlayer.getBetPot() * 2 + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
235
|
+ flag = false;
|
|
236
|
+ } else if (activePlayer == blackJackPlayer && stands < 2) {
|
|
237
|
+
|
|
238
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDealer's Current Hand: \n\nMYSTERY-CARD || " + formatHand(this.dealer.getDealerHand()) + "\n\nDealer's Hand Value: ??" +
|
|
239
|
+ "\n\n~~~~~~~~~~~~~~~~~~~\n\nYour Current Hand: \n\n" + formatHand(blackJackPlayer.getPlayerHand()) + "\n\nYour Hand Value: " + formatHandValue(handValue) +
|
|
240
|
+ "\n\n~~~~~~~~~~~~~~~~~~~\n\nYOUR TURN" + "\n\n~~~~~~~~~~~~~~~~~~~\n\nWhat do you want to do?\n<< Hit - Stand - Double Down - Split - Quit >>");
|
|
241
|
+ String inputResponse = scanner.nextLine();
|
|
242
|
+ String response = inputResponse.toUpperCase();
|
|
243
|
+
|
|
244
|
+ switch (response) {
|
|
245
|
+ case "HIT":
|
|
246
|
+ hit(blackJackPlayer);
|
|
247
|
+
|
|
248
|
+ if (blackJackPlayer.getHandValue() > 21) {
|
|
249
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Current Hand: \n\n" + formatHand(blackJackPlayer.getPlayerHand()) + "\n\nYour Hand Value: " + blackJackPlayer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nToo high, you lose!");
|
|
250
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() - blackJackPlayer.getBetPot());
|
|
251
|
+ System.out.println("\nYou Lost $" + blackJackPlayer.getBetPot() + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
252
|
+ flag = false;
|
|
253
|
+ } else if (blackJackPlayer.getHandValue() == 21) {
|
|
254
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Current Hand: \n\n" + formatHand(blackJackPlayer.getPlayerHand()) + "\n\nYour Hand Value: " + blackJackPlayer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nYou win!!! YAYAYAYAYAYAYYAYAYAYAYAYYY");
|
|
255
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() + blackJackPlayer.getBetPot());
|
|
256
|
+ System.out.println("\nYou Won: $" + blackJackPlayer.getBetPot() + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
257
|
+ flag = false;
|
|
258
|
+ }
|
|
259
|
+ break;
|
|
260
|
+ case "STAND":
|
|
261
|
+ setNumOfTurns(turnNumber++);
|
|
262
|
+ stand();
|
|
263
|
+ stands++;
|
|
264
|
+ break;
|
|
265
|
+ case "DOUBLE DOWN":
|
|
266
|
+ if (getJustDealt()) {
|
|
267
|
+ doubleDown(activePlayer);
|
|
268
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Current Bet: " + blackJackPlayer.getBetPot());
|
|
269
|
+ } else {
|
|
270
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYou can only double down right after the deal. Please choose another option.");
|
|
271
|
+ }
|
|
272
|
+ break;
|
|
273
|
+ case "SPLIT":
|
|
274
|
+ split(activePlayer);
|
|
275
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nok so the code itself works but idk how to actually implement it into the game without going crazy so plz choose something else");
|
|
276
|
+ break;
|
|
277
|
+ case "QUIT":
|
|
278
|
+ instance.chooseGame();
|
|
279
|
+ break;
|
|
280
|
+ default:
|
|
281
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nInput unknown, please try again");
|
|
282
|
+ break;
|
|
283
|
+ }
|
|
284
|
+ } else if (activePlayer == this.dealer && stands < 2) {
|
|
285
|
+
|
|
286
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDEALER'S TURN");
|
|
287
|
+
|
|
288
|
+ if (this.dealer.getHandValue() > 15 && this.dealer.getHandValue() < 21) {
|
|
289
|
+ setNumOfTurns(turnNumber++);
|
|
290
|
+ stand();
|
|
291
|
+ } else {
|
|
292
|
+ hit(this.dealer);
|
|
293
|
+
|
|
294
|
+ if (this.dealer.getHandValue() > 21) {
|
|
295
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDealer's Current Hand: \n\n" + formatHand(this.dealer.getPlayerHand()) + "\n\nDealer's Hand Value: " + this.dealer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nDealer bust, you win!");
|
|
296
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() + blackJackPlayer.getBetPot());
|
|
297
|
+ System.out.println("\nYou Won: $" + blackJackPlayer.getBetPot() + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
298
|
+ flag = false;
|
|
299
|
+ } else if (this.dealer.getHandValue() == 21) {
|
|
300
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDealer's Current Hand: \n\n" + formatHand(this.dealer.getPlayerHand()) + "\n\nDealer's Hand Value: " + this.dealer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nBlackjack! Dealer wins!");
|
|
301
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() - blackJackPlayer.getBetPot());
|
|
302
|
+ System.out.println("\nYou Lost $" + blackJackPlayer.getBetPot() + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
303
|
+ flag = false;
|
|
304
|
+ } else if (handValue.get(0) < 21 || (handValue.size() > 2 && handValue.get(1) < 21)) {
|
|
305
|
+ setNumOfTurns(turnNumber++);
|
|
306
|
+ stand();
|
|
307
|
+ }
|
|
308
|
+ }
|
|
309
|
+ stands++;
|
|
310
|
+
|
|
311
|
+ } else if (stands == 2) {
|
|
312
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nDETERMINING WINNER...");
|
|
313
|
+
|
|
314
|
+ if (blackJackPlayer.getHandValue() > this.dealer.getHandValue()) {
|
|
315
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Hand Value: " + blackJackPlayer.getHandValue() + "\n\nDealer's Hand Value: " + this.dealer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nYou win!");
|
|
316
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() + blackJackPlayer.getBetPot());
|
|
317
|
+ System.out.println("\nYou Won: $" + blackJackPlayer.getBetPot() + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
318
|
+ } else if (blackJackPlayer.getHandValue() < this.dealer.getHandValue()) {
|
|
319
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Hand Value: " + blackJackPlayer.getHandValue() + "\n\nDealer's Hand Value: " + this.dealer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nDealer wins! You lose!");
|
|
320
|
+ blackJackPlayer.getPlayer().setWallet(blackJackPlayer.getPlayer().getWallet() - blackJackPlayer.getBetPot());
|
|
321
|
+ System.out.println("\nYou Lost $" + blackJackPlayer.getBetPot() + "\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
322
|
+ } else if (blackJackPlayer.getHandValue() == this.dealer.getHandValue()) {
|
|
323
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nYour Hand Value: " + blackJackPlayer.getHandValue() + "\n\nDealer's Hand Value: " + this.dealer.getHandValue() + "\n\n~~~~~~~~~~~~~~~~~~~\n\nTie, no one wins");
|
|
324
|
+ System.out.println("\nCurrent Wallet: $" + blackJackPlayer.getPlayer().getWallet());
|
|
325
|
+ }
|
|
326
|
+ flag = false;
|
|
327
|
+ }
|
|
328
|
+ }
|
|
329
|
+
|
|
330
|
+ this.dealer.resetHand();
|
|
331
|
+ blackJackPlayer.resetHand();
|
|
332
|
+ setNumOfTurns(0);
|
|
333
|
+ setStands(0);
|
|
334
|
+ blackJackPlayer.setInitialBet(0);
|
|
335
|
+ blackJackPlayer.setBetPot(0);
|
|
336
|
+
|
|
337
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nWould you like to play again?\n\n<< Yes - No >>");
|
|
338
|
+ String userInput = scanner.nextLine();
|
|
339
|
+ String input = userInput.toUpperCase();
|
|
340
|
+
|
|
341
|
+ switch (input) {
|
|
342
|
+ case "YES":
|
|
343
|
+ start();
|
|
344
|
+ break;
|
|
345
|
+ case "NO":
|
|
346
|
+ System.out.println("\n~~~~~~~~~~~~~~~~~~~\n\nReturning to the Casino!");
|
|
347
|
+ // go back to casino
|
|
348
|
+ instance.chooseGame();
|
|
349
|
+ break;
|
173
|
350
|
}
|
|
351
|
+
|
|
352
|
+
|
174
|
353
|
}
|
175
|
354
|
|
176
|
355
|
public void end() {
|
|
@@ -178,7 +357,6 @@ public class BlackJack extends CardGame implements Gamble {
|
178
|
357
|
}
|
179
|
358
|
|
180
|
359
|
public void takeATurn() {
|
181
|
|
-
|
182
|
360
|
}
|
183
|
361
|
|
184
|
362
|
// add to game interface?
|
|
@@ -199,6 +377,10 @@ public class BlackJack extends CardGame implements Gamble {
|
199
|
377
|
}
|
200
|
378
|
}
|
201
|
379
|
|
|
380
|
+ public ArrayList<BlackJackPlayer> getBlackJackPlayers() {
|
|
381
|
+ return blackJackPlayers;
|
|
382
|
+ }
|
|
383
|
+
|
202
|
384
|
public int betAmount(int amount, BlackJackPlayer blackJackPlayer) {
|
203
|
385
|
blackJackPlayer.addToBetPot(amount);
|
204
|
386
|
return betAmount(amount, blackJackPlayer.getPlayer());
|
|
@@ -220,6 +402,22 @@ public class BlackJack extends CardGame implements Gamble {
|
220
|
402
|
this.justDealt = justDealt;
|
221
|
403
|
}
|
222
|
404
|
|
|
405
|
+ public int getStands() {
|
|
406
|
+ return stands;
|
|
407
|
+ }
|
|
408
|
+
|
|
409
|
+ public void setStands(int stands) {
|
|
410
|
+ this.stands = stands;
|
|
411
|
+ }
|
|
412
|
+
|
|
413
|
+ public int getNumOfTurns() {
|
|
414
|
+ return numOfTurns;
|
|
415
|
+ }
|
|
416
|
+
|
|
417
|
+ public void setNumOfTurns(int numOfTurns) {
|
|
418
|
+ this.numOfTurns = numOfTurns;
|
|
419
|
+ }
|
|
420
|
+
|
223
|
421
|
public String formatHand(ArrayList<Card> array) {
|
224
|
422
|
String stringHand = "";
|
225
|
423
|
|
|
@@ -232,7 +430,6 @@ public class BlackJack extends CardGame implements Gamble {
|
232
|
430
|
stringHand += " || ";
|
233
|
431
|
}
|
234
|
432
|
}
|
235
|
|
-
|
236
|
433
|
return stringHand;
|
237
|
434
|
}
|
238
|
435
|
|