Project 3 – Blackjack

Due: April 4th, 2006 by class

 

Blackjack (also known as 21) is a multiplayer card game, with fairly simple rules.  For this assignment, you will be implementing a simplified version where a user can play against the computer who acts as dealer.

 

Two cards are dealt to each player. The dealer shows one card face up, and the other is face down.  The player gets to see both of his or her cards and the total of them is added.  Face cards (Kings, Queens, and Jacks) are worth 10 points, Aces are worth 1 or 11 points, and all other cards are worth their face value.  The goal of the game is to get as close to 21 (“blackjack”) without going over (called “busting.”)

 

The human player goes first, making his or her decisions based on the single dealer card showing. The player has two choices: Hit or Stand.  Hit means to take another card.  Stand means that the player wishes no more cards, and ends the turn, allowing for the dealer to play.

 

The dealer must hit if their card total is less than 17, and must stand if it is 17 or higher. 

 

Whichever player gets closest to 21 without exceeding it, wins.

 

Interface

 

 

 

        

 

The interface should have a menu with a new and exit options. When the new menu item is clicked, the game should begin. Deal two cards to the player and show their total. Deal 2 cards to the dealer, however, only show 1 card in the interface.

 

Enable the Hit and Stand buttons so the player can play. The player should be able to play until they hit the stand button or they go over 21. If they bust, the hit and stand buttons get disabled, and a message saying the game is over should be displayed.

 

When the stand button is hit, the dealer’s cards are revealed, and the dealer plays using the rules above. When the dealer is done playing, a winner is determined and displayed in a message box. The game is then over until the user chooses new again from the menu.

 

Requirements

 

For this assignment you need to do the following:

 

 

 

 

Hints and Tips

 

 

 

 

 

Submission

 

Place your files into a zip folder as we did for the last assignment. The URL for submission is:

 

http://www.cs.pitt.edu/~jmisurda/submit/

 

It will go live at class time Tuesday (no submissions accepted prior to that.)

 

If you want help, make sure you see me before the deadline.

 

The username and password will again be cs0004 and vbrocks