When out of money the option to top up or end the game is given. The player sets an initial balance, deals and then hits or stands until either getting a blackjack, winning, losing or pushing. Source files are located in src when compiling, be sure to include the image resources in the repo root. This project is an extra credit thing so I guess we are supposed to look elsewhere to find this info. However my book only has one page devoted to Command-Line Arguments. InstallationĪfter cloning or downloading, it should be possible to import directly into the Eclipse IDE (or similar). It is to create a Black-Jack Game with a Command Line Interface.
The code is well commented so should be pretty easy to understand. The game contains 3 instances of CardGroup - one for the dealer's initial (shuffled) deck, and two for the player and dealer cards which are displayed using CardGroupPanel.Ĭards are popped from the dealer's deck and added to the player or dealer card group each time a player hits or dealer takes a card. If more than one Ace is present, only one can change value.Įach card is an instance of Card, stored in a CardGroup and the contents of a CardGroup can be displayed as a CardGroupPanel, an extension of Swing's JPanel.
The game is written in Java (developed in Eclipse) using Swing/AWT for the GUI. This is a one-player blackjack game, where the player plays against the dealer.