/java-blackjack

Simple automatic blackjack game in Java.

Primary LanguageJava

java-blackjack

Simple automatic blackjack game in Java.

Written to showcase how one could design a deck of cards and game in an object-oriented manner.

sample output

Winner is: Player 2 (hand: [NINE of HEARTs, TWO of SPADEs, QUEEN of HEARTs], total: 21)
Winner is: Player 1 (hand: [ACE of DIAMONDs, TWO of HEARTs, TWO of DIAMONDs, SIX of DIAMONDs], total: 21)
Winner is: Dealer (hand: [SIX of HEARTs, FIVE of CLUBs, TEN of CLUBs], total: 21)
Push
Winner is: Player 3 (hand: [EIGHT of SPADEs, JACK of SPADEs], total: 18)
Winner is: Dealer (hand: [JACK of CLUBs, NINE of HEARTs], total: 19)
Winner is: Player 1 (hand: [ACE of HEARTs, JACK of SPADEs], total: 21)
Winner is: Player 1 (hand: [FIVE of SPADEs, FOUR of CLUBs, QUEEN of SPADEs], total: 19)
Winner is: Player 1 (hand: [ACE of CLUBs, TEN of DIAMONDs], total: 21)
Winner is: Dealer (hand: [TWO of DIAMONDs, NINE of DIAMONDs, ACE of HEARTs, FIVE of CLUBs, FOUR of HEARTs], total: 21)
Winner is: Player 2 (hand: [KING of DIAMONDs, ACE of SPADEs], total: 21)
Winner is: Player 2 (hand: [JACK of DIAMONDs, KING of DIAMONDs], total: 20)
Winner is: Dealer (hand: [JACK of DIAMONDs, SIX of SPADEs, THREE of HEARTs], total: 19)
Winner is: Player 3 (hand: [FIVE of CLUBs, FIVE of DIAMONDs, ACE of DIAMONDs], total: 21)
Winner is: Player 1 (hand: [TEN of HEARTs, ACE of SPADEs], total: 21)
Winner is: Player 1 (hand: [JACK of DIAMONDs, TEN of DIAMONDs], total: 20)
Winner is: Player 1 (hand: [JACK of DIAMONDs, JACK of HEARTs], total: 20)
Winner is: Player 2 (hand: [JACK of HEARTs, KING of CLUBs], total: 20)
Push
Winner is: Player 1 (hand: [EIGHT of SPADEs, SIX of CLUBs, SEVEN of SPADEs], total: 21)
Winner is: Player 3 (hand: [TEN of HEARTs, TEN of DIAMONDs], total: 20)
Push
Winner is: Player 2 (hand: [THREE of SPADEs, SEVEN of DIAMONDs, ACE of CLUBs], total: 21)
Winner is: Dealer (hand: [SEVEN of HEARTs, KING of DIAMONDs, THREE of HEARTs], total: 20)
Winner is: Dealer (hand: [ACE of SPADEs, FIVE of CLUBs, KING of HEARTs, FOUR of SPADEs], total: 20)
Winner is: Player 3 (hand: [THREE of HEARTs, EIGHT of SPADEs, TEN of SPADEs], total: 21)
Number of games: 26
Dealer success: 23.076923