Introduction to Computer Science II

Project 5 for 2007-Nov-07

Blackjack


The game of Blackjack

We are going to write a program to play the popular and simple card game of Blackjack. Specifically, your program is going to play the role of dealer, and the user interface will the user(s) to be the players against the dealer.

In our version of the game, we will rely on standard playing cards. More specifically, a game of Blackjack will rely on a shoe of cards, where multiple decks are shuffled together. Thus, if 5 decks are used, then there will be 52 * 5 = 260 cards total, with 5 aces of spades, 5 jacks of clubs, etc.

We are going to use a reasonably simplified set of the rules of Blackjack to avoid needless complexity. Here is how a game progresses:

  1. Each player places a bet.

  2. The dealer gives two cards to each player, face-up.

  3. The dealer gives itself two cards, one face-up, and the other face-down (the hole card).

  4. One player at a time, the dealer allows each player to hit (be dealt another card) as many times as the player chooses until either:

    Once the player stays or busts, the player's turn is over.

  5. The dealer reveals its hole card, and then proceeds to hit (deal cards to its own hand) until either:

  6. Bets are then handled depending on the outcome of the hands. Specifically:

  7. If the player is out of money or chooses not to play again, the player's game is then done.


Classes to create

This project requires a number of classes -- some free-standing, others based on inheritance relationships. Below are a list of the classes and descriptions of their roles in this program. I have ordered them roughly from the top down (that is, higher-level to lower-level).


The command line

When a user runs this program, she will have to specify a number of items on the command line. Specifically, here is the usage for the program:

java Blackjack [number of decks] [number of players] [container type (Array, List)] [initial money per player]

Submitting your work

From within your project-5 subdirectory, use the following command to submit you work (all of your Java code files) when you are done:

cs12-submit project-5 *.java

This assignment is due Wednesday, 2007-Nov-07, at 11:59 pm

Scott F. H. Kaplan
Last modified: Tue Jan 8 15:28:37 EST 2008