|
HOME WORK #3 - Due July 31 by midnight
This assignment is worth double
You must email this project to the TA (to be announced)
Problem:
Programming the game of Black Jack between four players not including
the dealer (computer):
Background:
A deck of cards contains 52 cards, which consists of four suits
(hearts, diamonds, clubs and spades), each containing the set {2,
3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace}.
A simplified version of Black Jack is as follows: an Ace is worth
1 or 11 (your choice), 10, Jack, Queen and King are all worth 10 points,
and all other cards are worth their numerical value. The goal of the
game is to get as close to 21 as possible without exceeding 21. To
begin, you and the dealer are dealt two cards each and you can either hit
(get another card) or stick (no additional cards). If you tie with the dealer,
the dealer wins.
Details:
You are to only program the simplified version described above
- forget the details of actual casino rules and so forth.
The program can allow for up to four players.
Players are ONLY allowed place an initial bet (so there must
be an accounting system for money). Therefore, there is a bank (unlimited
funds) that the dealer has direct access to, and the bank places loans to
players (i.e., players do not enter with their own funds).
You must keep track of the score (hands lost per opponent) and
winnings/losses.
BLACK JACK (an ace and a card valued at 10 points) is an automatic
win (dealer advantage).
The dealer cannot "stick" for anything under 16 points.
Use your deck function from the last assignment.
Look online for more information on this game.
The "fluff" is not important (it doesn't mater how the output
looks so long as it's neat) - it only matters that the program works
and works efficiently.
Of course, it must be an INTERACTIVE PROGRAM - humans versus
the machine.
Also, you must comment your code adequately.
This program is to be written in the procedural paradigm.
Once again, you are only allowed to apply OOP for shuffling the
deck if you choose to.
|