BlackJack.java - package BlackJack import java.util.ArrayList import java.util.Scanner public class BlackJack cfw public static void main(String args

BlackJack.java - package BlackJack import...

This preview shows page 1 - 2 out of 3 pages.

package BlackJack; import java.util.ArrayList; import java.util.Scanner; public class BlackJack { public static void main(String[] args) { System.out.println("Welcome to Play BlackJack!"); Deck playingDeck = new Deck(); playingDeck.createDeck(); playingDeck.shuffle(); /** * create hands for player and dealer */ Deck player = new Deck(); Deck dealer = new Deck(); //Player's Starting Money double money = 100; Scanner input_2 = new Scanner(System.in); Scanner input_3 = new Scanner(System.in); //Game Loop Begin while (money > 0) { //again = input_1.nextInt(); //System.out.println("Do you still want to play? (1)Yes, (2)No"); System.out.println("You have $" + money); System.out.println("How much would you bet this round?"); boolean roundEnd = false; int bet = input_2.nextInt(); if (bet > money) { System.out.println("Your don't have enough money to bet!"); break; } /** * Player's initial hands. * Will have two cards */ player.deal(playingDeck); player.deal(playingDeck); /** * Deal's initial hands. * Will have two cards * one of the cards are hidden */ dealer.deal(playingDeck); dealer.deal(playingDeck); while (true) { //Player's Hand and value System.out.println("Your Hand: " + player.toString());
Image of page 1
Image of page 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture