Dive into the world of cards with this Python Blackjack Game! Play and test your luck and strategy in this classic casino game.
This Python Blackjack Game brings the excitement of the casino to your terminal! It's a classic card game where you aim to beat the dealer by getting a hand value as close to 21 as possible without exceeding it. Test your luck and strategy with this entertaining Python project.
In this Python Blackjack Game, we follow the classic rules of the game. Here's a brief overview:
-
Objective:
- The main goal is to beat the dealer by having a hand value as close to 21 as possible without exceeding it.
-
Card Values:
- Number cards (2 - 10) are worth their face value.
- Face cards (Jack, Queen, King) are each worth 10.
- Aces can be worth 1 or 11, depending on which value benefits the hand more.
-
The Deal:
- The player is initially dealt two cards.
- The dealer is also dealt two cards, with one card face up and the other face down.
-
Gameplay:
- The player can choose to 'hit' (take another card) or 'stand' (keep the current hand).
- If the player's hand value exceeds 21, they 'bust' and lose the round.
- The dealer reveals their face-down card after the player's turn.
-
Dealer's Turn:
- The dealer must hit until their hand value is at least 17.
- If the dealer busts, the player wins the round.
-
Winning:
- The player wins if their hand value is closer to 21 than the dealer without busting.
- If the player and dealer have the same hand value, it's a 'push' (tie).
-
Blackjack:
- If a player is dealt an Ace and a 10-value card (10, Jack, Queen, King) as their initial two cards, they have a 'Blackjack' and usually win the round.
These are simplified rules, and there might be variations depending on the specific Blackjack variant you are playing.
♥️♠️ Do you want to play a game of Blackjack? (yes, no) ♦️♣ yes
Your cards: [10, 8] current score: 18
Computer's first card: 8
Type 'hit' to get another card, type 'stand' to pass: stand
Your final hand: [10, 8], final score: 18
Computer's final hand: [8, 6, 1, 9], final score: 24
Opponent went over. You win 😁
Contributions are always welcome! Whether you find a bug, have a suggestion, or want to add a feature—just open an issue or submit a pull request. Let's improve this project together! ✨
This project is licensed under MIT license.
Manjunath MGM
Shiv Nadar University
[email protected]