Skip to content

Created the popular card game known as Blackjack using only Python as well as tests to double-check the code.

Notifications You must be signed in to change notification settings

Gbemiga04/Blackjack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This python program runs the popular card game known as Blackjack. The rules are relatively simple: Objective: The primary goal of blackjack is to beat the dealer's hand without going over 21. Card Values: Cards 2 through 10 are worth their face value. Face cards (Jack, Queen, King) are each worth 10 points. Aces can be worth either 1 point or 11 points, depending on which value is more advantageous to the player's hand. Gameplay: The game begins with each player and the dealer receiving two cards. Players' cards are usually dealt face up, while one of the dealer's cards is dealt face down (the hole card). Player's Turn: After receiving their initial two cards, players have several options: Hit: Take another card from the dealer. Players can hit as many times as they like, but if the total value of their hand exceeds 21, they bust and lose the round. Stand: Decline additional cards and keep the current hand. Double Down: Double the initial bet and take exactly one more card. This option is only available on the first two cards, and usually, there are restrictions on which hands can double down. Split: If the first two cards have the same value, players can split them into two separate hands, each with its own bet. Additional cards are then dealt to each hand. Some variations of blackjack allow re-splitting if another pair is dealt. Surrender: In some versions, players can surrender their hand, forfeiting half of their bet, rather than playing the hand out. Dealer's Turn: Once all players have completed their actions, the dealer reveals their hole card. The dealer must hit if their hand total is less than 17 and stand on 17 or higher. Some casinos have variations where the dealer must hit on a soft 17 (a hand totaling 17 with an Ace counting as 11). Winning: After the dealer's turn, winners are determined. Players win if their hand is closer to 21 than the dealer's hand without exceeding it. If a player's hand is the same value as the dealer's hand, it's a push (tie), and the player's bet is returned. Blackjack: If a player's first two cards are an Ace and a 10-value card (10, Jack, Queen, King), they have a blackjack. A blackjack typically pays out 3:2 (1.5 times the bet), unless the dealer also has a blackjack, in which case it's a push. These are the basic rules of blackjack. Variations may exist depending on the specific casino or house rules. It's essential to familiarize yourself with the specific rules of the game you're playing before you start.

THANK YOU!

NOTE: The completed product of this project was uploaded at once rather than starting it and regularly updating it. I didn't understand how Github works when I started the project. Thanks for understanding.

About

Created the popular card game known as Blackjack using only Python as well as tests to double-check the code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages