Blackjack Card-Game in C Rules: The player is dealt two cards, face up. The dealer is also dealt two cards, one up (exposed) and one down (hidden). The value of cards two through ten is their pip value (2 through 10). Face cards (Jack, Queen, and King) are all worth ten. Aces can be worth one or eleven. A hand's value is the sum of the card values. The player is allowed to draw additional cards to improve his hand. A hand with an ace valued as 11 is called "soft", meaning that the hand will not bust by taking an additional card. The value of the ace will become one to prevent the hand from exceeding 21. Otherwise, the hand is called "hard". Once the player has completed his hand, it is the dealer's turn. The dealer hand will not be completed if all players have either busted or received blackjacks. The dealer then reveals the hidden card and must hit until the cards total up to 17 points. At 17 points or higher the dealer must stay. You are betting that you have a better hand than the dealer. The better hand is the hand where the sum of the card values is closer to 21 without exceeding 21. The detailed outcome of the hand follows: If the player is dealt an Ace and a ten-value card (called a "blackjack" or "natural"), and the dealer does not, the player wins. If the player exceeds a sum of 21 ("busts"), the player loses, even if the dealer also exceeds 21. If the dealer exceeds 21 ("busts") and the player does not, the player wins. If the player attains a final sum higher than the dealer and does not bust, the player wins. If both dealer and player receive a blackjack or any other hands with the same sum called a "push", no one wins. the program starts the user off with 500$ credits and continues playing until the user runs out of credits or quits. The main input components are hit, stand, bet $, and qui
Design Blackjack Card-Game in C
Rules:
The player is dealt two cards, face up. The dealer is also dealt two cards, one up (exposed) and one down (hidden).
The value of cards two through ten is their pip value (2 through 10). Face cards (Jack, Queen, and King) are all worth ten. Aces can be worth one or eleven.
A hand's value is the sum of the card values. The player is allowed to draw additional cards to improve his hand.
A hand with an ace valued as 11 is called "soft", meaning that the hand will not bust by taking an additional card. The value of the ace will become one to prevent the hand from exceeding 21. Otherwise, the hand is called "hard".
Once the player has completed his hand, it is the dealer's turn. The dealer hand will not be completed if all players have either busted or received blackjacks. The dealer then reveals the hidden card and must hit until the cards total up to 17 points. At 17 points or higher the dealer must stay. You are betting that you have a better hand than the dealer. The better hand is the hand where the sum of the card values is closer to 21 without exceeding 21. The detailed outcome of the hand follows:
- If the player is dealt an Ace and a ten-value card (called a "blackjack" or "natural"), and the dealer does not, the player wins.
- If the player exceeds a sum of 21 ("busts"), the player loses, even if the dealer also exceeds 21.
- If the dealer exceeds 21 ("busts") and the player does not, the player wins.
- If the player attains a final sum higher than the dealer and does not bust, the player wins.
- If both dealer and player receive a blackjack or any other hands with the same sum called a "push", no one wins.
the program starts the user off with 500$ credits and continues playing until the user runs out of credits or quits. The main input components are hit, stand, bet $, and quit.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps