Skip to content

A black jack done only using python which you can test in python's terminal

Notifications You must be signed in to change notification settings

JorgeAJT/black-jack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Black Jack Project in Python

Welcome to the Black Jack project in Python! This project is a simple implementation of the popular card game Black Jack, developed entirely in Python.

Description

This project simulates a game of Black Jack where the player competes against the dealer. The goal of the game is to get a hand with a value as close to 21 as possible without exceeding it, and to surpass the dealer's hand value.

Features

  • Single-player game against the dealer.
  • Basic Black Jack rules.
  • Interactive text-based interface.
  • Clean and modular code for easy understanding and extension.

System Requirements

  • Python 3.x

Installation

  1. Clone this repository to your local machine.

    git clone https://github.com/JorgeAJT/black-jack.git
    
  2. Navigate to the project directory

    cd blackjack-python
    
  3. (Optional) Create and activate a virtual environment.

    python3 -m venv env
    source env/bin/activate  # On Windows use `env\Scripts\activate`
    
  4. Install the necessary dependencies (if any).

    pip install -r requirements.txt
    

Usage

  • To start the game, simply run the main.py script:

    python main.py
    

Game Rules

  1. Initial Deal: Two cards are dealt to the player and two to the dealer. One of the dealer's cards remains hidden until the end of the game.

  2. Player's Turn: The player can choose to "Hit" (receive an additional card) or "Stand" (keep their current hand), in case it is not a straight blackjack, in that case the player win directly.

  3. Dealer's Turn: After the player stands, the dealer reveals their hidden card and decides to "Hit" or "Stand" based on fixed rules (typically, the dealer hits on 16 or less and stands on 17 or more).

  4. Determining the Winner:

  • If the player exceeds 21, they lose.
  • If the dealer exceeds 21, the player wins.
  • If neither exceeds 21, the hand with the lower value wins.
  • In the event of a tie, the number of cards is counted and the player with the fewest cards wins. In case of an equal number of cards, the match is considered a draw.

Contributions

Contributions are welcome. Please follow these steps:

  1. Fork the project.

  2. Create a new branch with your changes:

    git checkout -b my-branch
    
  3. Make your changes and commit them:

    git commit -m "Description of my changes"
    
  4. Push your changes to your forked repository:

    git push origin my-branch
    
  5. Create a Pull Request on GitHub.

Author

Jorge Jiménez - JorgeAJT

About

A black jack done only using python which you can test in python's terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages