A Python implementation of the classic Blackjack card game.
Blackjack is a popular casino banking game played with one or more decks of 52 cards. The objective is to have a hand value that is closer to 21 than the dealer's hand without exceeding 21. Numbered cards are worth their face value, while face cards (Jack, Queen, King) are worth 10 points. An Ace can be worth either 1 or 11 points, depending on which is more beneficial to the player.
You have two options:
To run the game locally, you'll need to set up a Python environment. Here's how:
Install Python: Install Python 3.9 or later from the official website if you haven't already.
Create Virtual Environment: Create a new virtual environment using python -m venv blackjack-env (replace "blackjack-env" with your preferred name).
Activate Virtual Environment: Activate the virtual environment by running source blackjack-env/bin/activate on Linux/Mac or blackjack-env\Scripts\activate on Windows.
Install Dependencies: Install the required dependencies from the requirements.txt file using pip install -r requirements.txt.
Clone Repository: Clone this repository and navigate to the project directory.
Run Game: Run the game using python main.py.
Option 2:Play Online If you'd rather not set up a local environment, play the game online
The game features three buttons:
- Deal: Start a new game by dealing two cards to the player and the dealer.
- Hit: Take an additional card from the deck to try to get closer to 21.
- Stand: Keep the current hand and end the player's turn.
Use these buttons to play the game and try to beat the dealer's hand!
Enjoy playing Blackjack!