A command-line Blackjack game built using Python with Object-Oriented Programming (OOP). This project simulates a real casino-style Blackjack experience including betting, dealer rules, and soft Ace handling.
- 🎮 Interactive CLI gameplay
- 🧠 OOP design (
Deck,Hand,Game) - 💰 Betting system with balance tracking
- 🃏 Realistic Blackjack rules
- ⚡ Instant Blackjack detection (natural 21)
- 🔁 Replay system
- 📊 Dynamic win/loss handling
-
Goal: Get as close to 21 as possible without exceeding it
-
Number cards = face value
-
Face cards (J, Q, K) = 10
-
Ace = 1 or 11 (auto-adjusted)
-
Dealer:
- Hits below 17
- Hits on soft 17
-
Bust (>21) → instant loss
-
Equal score → draw (push)
-
Blackjack (Ace + 10 in first 2 cards):
- Pays 1.5× bet
- Both Blackjack → draw
blackjack/
│
├── main.py # Main game file
└── README.md # Project documentation
git clone https://github.com/Sahdevagarwal/Blackjack.git
cd blackjackpython main.py--- New Game ---
Your balance: 1000
Enter your bet: 100
Your hand: [10, 7], score: 17
Dealer's hand: 9
Hit or Stand? hit
Your hand: [10, 7, 2], score: 19
Hit or Stand? stand
Final Result:
Dealer's hand: [9, 8], score: 17
You win!
- Object-Oriented Programming (OOP)
- Game state management
- Conditional logic
- Loops & control flow
- Input validation
- 🎨 GUI using
pygameortkinter - 🃏 Card visuals instead of numbers
- 🔊 Sound effects
- 📈 Game statistics
- 🤖 AI-based suggestions
- 🌐 Multiplayer
- Uses simplified deck (no suits)
- Ace handled dynamically (11 → 1 when needed)
- Deck resets every round
This project is licensed under the MIT License.
Developed by Sahdev Agarwal as a personal project to learn:
- Python OOP
- Game logic
- Clean code practices
If you like this project:
- ⭐ Star the repo
- 🍴 Fork it
- 🚀 Build on it