Mrs. Romero's Computer Lab

BlackJack - Game of 21

Home
Computer Graphics
Applications
Keyboarding
Website Design
Student Sites
Programming

Description

The Game of 21 application deals two cards to the user (player) and two cards to the computer. The cards dealt are randomly selected and are in the range 1 to 13, inclusive. 

 

The results of these two deals will be handled differently for the computer and the player as follows:

·         The cards for the computer will be totaled. If the total is 16 or less, the computer will receive another card automatically, otherwise it will stay.

·         The player will be able to decide whether to “Hit” (get a third card) or “Stay”.

 

Totals are compared to see who won according to the following standards:

 

If…                                                         The result is…

Totals are equal                                             A draw

Totals are both over 21                                  A draw

Player >21 and computer <=21                     A win for computer

Computer > 21 and Player <= 21                  A win for Player

Player <= 21 and Computer <= 21                A win for the higher total

 

The winner is displayed in a message (You won! Computer won, or It's a draw!). The score is updated and displayed (1 point for each win.) The user has the option of repeatedly playing the game or starting a new one. The scores are maintained until the user quits the application.

 

The faces of the cards are located in the following drive:

S:\Electronic Handout\Computer Programming

Copy these into your own BlackJack folder.

 

 

 

Game of 21 – BlackJack – RUBRIC                                 Name:___________________________

 

Points

Earned

Task

5

 

Design the form and add controls to run the game and display card images

10

 

Generate random number for dealing cards using the Randomize keyword and the Rnd expression

10

 

Use a Case statement to evaluate the random number and determine face card and card value

10

 

Non-repetitive code, such as Case statement placed in a separate procedure and called from main procedure

10

 

Display face card images using the LoadPicture() function

10

 

Add up the values of the cards and keep a running total for player and for computer

10

 

Include code which allows player to “Hit” or “Stay”

10

 

Increase player’s total if Hit is selected

10

 

Use a nested If statement or Else If statement to determine which player is the winner

5

 

Display results of that hand in a label stating “You win!” or “Dealer wins” or “It’s a draw!”

10

 

Keep a running score for each player in a label.

100

 

Total