EECS 280 -- Winter 2008
Out: Friday, March 7,
Tuesday, March 25, 11:59 PM
This project will give you experience implementing abstract data
types, using interfaces (abstract base classes), and using
Blackjack, also sometimes called 21, is a relatively simple game
played with a standard deck of 52 playing cards.
There are two
principals, a dealer and a player.
The player starts with a bankroll,
and the game progresses in rounds called hands.
At the start of each hand, the player decides how much to wager on
It can be any amount between some minimum allowable wager
and the player's total bankroll, inclusive.
After the wager, the dealer deals a total of four cards: the first
face-up to the player, the second face-up to himself, the third
face-up to the player, the fourth face-down to himself.
The player then examines their cards, forming a total.
Each card 2-10
is worth its spot value
An ace is worth either 1 or 11--whichever is more
advantageous to the player.
If the total includes an ace counted as
11, the total is called "soft", otherwise it is called "hard".
Play progresses first with the player, then the dealer.
goal is to build a hand that is as close to 21 as possible without
going over---the latter is called a "bust", and a player who busts
loses the hand without forcing the dealer to play.
As long as the
player believes another card will help, the player "hits"---asks the
dealer for another card.
Each of these additional cards is dealt
This process ends either when the player decides to
stand---ask for no cards---or the player busts.
Note that a player
can stand with two cards
If the player is dealt an ace plus any ten or face card, the player's
hand is called a "natural 21", and the player's wager is paid off with
3 to 2 odds, without examining the dealer's cards.
In other words, if
the player had wagered 10, the player would win 15 if dealt a natural
If the player neither busts nor is dealt a natural 21, play then
progresses to the dealer.
The dealer *must* hit until he either
reaches a total greater than or equal to 17 (hard or soft), or busts.
If the dealer busts, the player wins.
Otherwise, the two totals are