public class Game { // return points player got on their turn public int playerTurn(Deck d) { Player player = new Player(); player.giveCard(d.deal()); player.giveCard(d.deal()); if (player.score() == 21) { System.out.println("You got Blackjack!"); return 21; } boolean hit = player.hitOrStay(); while (hit) { player.giveCard(d.deal()); if (player.score() == 21) { System.out.println("You got 21 points!"); return 21; } else if (player.score() > 21) { System.out.println("You busted!"); player.printHand(); return 0; } hit = player.hitOrStay(); } return player.score(); } public int houseTurn(Deck d) { House house = new House(); house.giveCard(d.deal()); house.giveCard(d.deal()); boolean hit = house.hitOrStay(); while (hit) { house.giveCard(d.deal()); hit = house.hitOrStay(); } if (house.score() > 21) { System.out.println("THe house busted!"); return 0; } System.out.println("The dealer's hand:"); house.printHand(); return house.score(); } public void play() { Deck d = new Deck(); d.buildStandardDeck(); d.shuffle(); int playerScore = playerTurn(d); int houseScore = houseTurn(d); if (playerScore > houseScore) { System.out.println("You won!"); } else if (playerScore < houseScore) { System.out.println("You lost!"); } else { System.out.println("You tied...which means you lost."); } } }