Skip to content

MMAbdul153/BlackJack-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

BlackJack-Python

Python Here’s a detailed and professional README file for your Multiplayer Blackjack Game project that can be used for your GitHub repository:


Multiplayer Blackjack Game with Dynamic Score Tracking and Elimination Logic

Overview

This project is a Python-based implementation of a Multiplayer Blackjack Game that supports multiple players in a dynamic, multi-round environment. The game simulates realistic Blackjack scenarios, including card drawing, dealer interaction, and player decisions. It features an elimination logic, where players are removed from the game based on their performance, and a scoring system that tracks wins, losses, and pushes.

Features

  • Multiplayer support: Play with as many players as you like, each with a separate score.
  • Real-time gameplay: Players can choose whether to hit or stand, with real-time feedback on their decisions.
  • Dynamic dealer interaction: Dealer plays according to standard Blackjack rules, hitting until reaching 17 or more.
  • Score tracking: Keeps track of each player’s score across multiple rounds, with win, loss, and push outcomes.
  • Player elimination: Players are eliminated when their score drops to zero, with seamless handling of simultaneous eliminations.
  • Blackjack logic: Full implementation of standard Blackjack rules, including Ace handling, busting, and automatic dealer behavior.

How to Play

  1. Start the game: The game begins by asking for the number of players and their names.
  2. Player turns: Each player gets two initial cards and then decides whether to "Hit" (draw another card) or "Stand" (end their turn).
  3. Dealer's turn: After all players have completed their turns, the dealer plays according to Blackjack rules.
  4. Round results: After the dealer's turn, the game compares each player’s hand to the dealer's hand and updates the scores:
    • Win: Player’s score is incremented.
    • Loss: Player’s score is decremented.
    • Push: Player’s score remains the same.
  5. Elimination: If a player's score reaches zero, they are eliminated. The game handles multiple eliminations smoothly.
  6. Game continuation: The game continues with remaining players until no players are left or the user chooses to end the game.

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/blackjack-multiplayer-game.git
  2. Navigate to the project directory:
    cd blackjack-multiplayer-game
  3. Run the game:
    python blackjack.py

Dependencies

This project has no external dependencies, as it uses Python's built-in libraries, specifically:

  • random for simulating card drawing.

Code Overview

Key Functions

  • draw_card(): Randomly selects and returns the value of a card (Ace through King).
  • print_card_name(card_rank): Prints the name of the card drawn.
  • draw_starting_hand(name): Draws two cards for a player or dealer and returns their initial hand value.
  • get_player_hand(player_hand): Allows the player to take additional cards (Hit) or stop (Stand) until their turn ends.
  • get_dealer_hand(): Manages the dealer’s turn, following standard Blackjack rules.
  • get_end_game_status(player_hand, dealer_hand): Determines the outcome of the round (win, loss, or push) based on hand values.
  • check_elimination(player, score_board, player_board): Checks if a player is eliminated (when their score reaches zero).

Game Flow

  1. Initialization: Players are prompted to enter their names, and each starts with a score of 3 points.
  2. Round Execution: Each player takes their turn, followed by the dealer’s turn. Afterward, the round results are calculated.
  3. Score Update & Elimination: Scores are updated based on the results, and players with scores of zero are eliminated.
  4. Next Round: Players can choose to play another round, and the game continues until all players are eliminated or the user quits.

Future Enhancements

  • Graphical User Interface (GUI): Adding a GUI to make the game more visually appealing and user-friendly.
  • Online Multiplayer: Extend the game to support online multiplayer functionality.
  • Advanced AI Dealer: Introduce more sophisticated dealer strategies to enhance gameplay.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue to discuss potential changes or improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Feel free to customize this further based on any additional features or notes you'd like to highlight.

About

Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages