[SOLVED] VE280-Project 3

30.00 $

Category:

Description

Rate this product

VE280 Project 3: Blackjack

Ⅱ. Introduction
You need to firstly help Joseph Joestar to implement this card game. It is played with a standard deck of 52 playing cards. There are two participants, a dealer and a player. The player starts with a bankroll, and the game progresses in hands and rounds.
At the start of each hand, the player decides how much to wager on this hand. The wager is an integer greater or equal to a minimum allowable wager and less than or equal to the player’s total bankroll.
After the wager, the dealer deals a total of four cards:
1. face-up to the player,
2. face-up to the dealer,
3. face-up to the player,
4. face-down to the dealer, hole card.
The player then examines his cards and calculate the total number of his card’s worth. Different cards have different worth:
2-10 is worth its spot value face card (jack, queen, king) is worth 10
Ace is worth 1 or 11, depending on which 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.
The game progresses first with the player, then the dealer. The player’s 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 and his bankroll will decrease by his wager. For cards whether soft or hard, players/dealers only care about the current situation, i.e. they are greedy. They do not have the ability to foresee. 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 face-up. 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; one need not hit at all in a hand.
Natural 21: The player is dealt an ace plus any 10 or face card (jack, queen, king) in his hand. His bankroll will increase by wager * 3 / 2.
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 compared:
If the dealer’s total is higher, the player’s bankroll decreases by the amount of his wager.
If the player’s total is higher, his bankroll increases by the amount of his wager. If the totals are equal, the bankroll is unchanged; this is called a push.
A hand ends in four cases:
1. The player get paid.
2. The player’s bankroll decreases.
3. They push.
4. The cards are used up, then they shuffle the cards and do this hand again.
A round consists of several hands. There is a maximum number of hands for each rounds. A round will end whenever one player is kicked out. A round ends in two cases:
1. The player’s bankroll cannot reach that minimum allowable wager. Then the player is kicked out and a new round start from Hand 1. The dealer’s remaining hand will be reset to the maximum number of hands.
2. Otherwise, if the allotted hands are all played and the player’s bankroll can still reach that minimum allowable wager, then the dealer is kicked out and a new round start from Hand
1. The player’s remaining hand will be reset to the maximum number of hands.
During the whole game process (before all the members of one team are kicked out), they will use the same set of cards, i.e. the cards will not be reset after the game starts.
When one round ends and the player wins, the bankroll will not be reset to the start bankroll. Instead, everyone will be provided the bankroll only when they enter the game. During the game process, i.e. the player has not been kicked out, the player can only get money from the dealer. When the player is kicked out of the game, he/she will not pass his/her remaining money to the next player.