-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
45 lines (30 loc) · 1.26 KB
/
Main.java
File metadata and controls
45 lines (30 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//Game game = new Game();
Blackjack blackjack = new Blackjack();
Player player = new Player(100);
boolean gameOn = blackjack.playGame(false, player);
Deck deck = blackjack.getDeck();
deck.shuffleDeck();
//TODO: Running out of cards?
while (gameOn) {
int bet = blackjack.makeBet(player);
List<List<Card>> initialList = blackjack.initialDeal(deck);
boolean playerBust = blackjack.playerLoop(initialList, deck, true, player);
boolean dealerBust = blackjack.dealerLoop(initialList, deck, true, player, bet);
int dealerValue = blackjack.getDealerValue();
int playerValue = blackjack.getPlayerValue();
blackjack.winLossCheck(playerBust, dealerBust, playerValue, dealerValue, player, bet);
gameOn = blackjack.playGame(gameOn, player);
int deckCount = deck.getListOfCards().size();
if (deckCount <= 26){
Game game = new Game();
deck = game.getDeck();
deck.shuffleDeck();
}
}
}
}