A text based implementation of the classic “Black Jack” game, written in Python. This project was built to practice object-oriented design, multi-file modularity, and game loop logic.
Black Jack is a popular card game where the goal is to beat the dealer by having a hand value closest to 21 without exceeding it. Players can “hit” (take another card) or “stand” (keep current hand), with special rules for dealer play, betting chips, and handling busts.
- Object-Oriented Programming: Card, Deck, Hand, Player, Chips classes.
- Multi-File Structure: Organized code with separate modules for clarity (e.g., card.py, deck.py, chips.py, utils.py, main.py).
- Command-Line Interaction: Playable through terminal input/output.
- Game Logic: Handles shuffling, dealing, hitting, standing, busts, dealer play, betting, and replaying.
- Pythonic State Control: Proper use of return values and function arguments to manage game flow.
main.py– Main game loopcard.py– Card classdeck.py– Deck classhand.py– Hand classchips.py– Betting system classconstants.py– Global constantsutils.py– Helper functions
- Clone/download this repo.
- Make sure you have Python 3.x installed.
- In your terminal, navigate to the project folder and run: python main.py
- Follow on-screen prompts to play and bet chips.
- Modular design with multiple files and imports.
- Managing game state and logic cleanly.
- Implementing betting and handling edge cases (ace values, busts, repeats).
Created by Shailya Gandhi (https://github.com/Shailya777) as part of my Python learning journey. Feedback and suggestions are welcome!