Skip to content

Simple CLI BlackJack Application. Simulates playing the game in real life without the risk of losing all your money.

Notifications You must be signed in to change notification settings

sekwanaa/BlackJack-Game

Repository files navigation

CLI BlackJack Game

Welcome to the CLI Blackjack Game, a command-line interface implementation of the classic casino game Blackjack. This project allows you to play Blackjack against the computer in your terminal.

Table of Contents

Features

  • Play classic Blackjack against the computer.
  • Simple and intuitive command-line interface.

Installation

Prerequisites

  • Java Development Kit (JDK) 17 or higher

Steps

  1. Clone the repository:
git clone https://github.com/yourusername/BlackJack-Game.git
  1. Navigate to the project directory:
cd BlackJack-Game
  1. Compile the Java files:
javac -d bin src/com/yourusername/blackjack/*.java

Usage

Run the game using the following command:

java -cp bin com.yourusername.blackjack.Blackjack

Commands

  • 'hit' - Draw another card.

  • 'stay' - End your turn.

  • 'insurance' - Take insurance if the dealer shows an Ace.

    To do

    • 'double' - Double your bet, draw one more card, and end your turn.
    • 'split' - Split your hand into two hands (if you have a pair).

Rules

The objective of Blackjack is to beat the dealer by having a hand value closer to 21 without exceeding it.
Here are some key rules:

  • Card Values: Number cards are worth their face value, face cards (King, Queen, Jack) are worth 10, and Aces can be worth 1 or 11.
  • Gameplay:
    • Each player is dealt two cards, face up. The dealer is dealt two cards, with one face up and one face down.
    • Players must decide to hit, stand, double, or split.
    • The dealer reveals the hidden card and must hit until their cards total 17 or higher.
  • Winning:
    • If your hand is closer to 21 than the dealer’s hand, you win.
    • If your hand exceeds 21, you bust and lose the bet.
    • If the dealer busts, you win.
    • If you and the dealer have the same total, it's a push (tie).

For a complete set of rules, please refer to the BlackJack Rules.

Contributing

We welcome contributions to this project!
To contribute:

  1. Fork the repository.
  2. Create a new branch:
git checkout -b feature-name
  1. Make your changes and commit them:
git commit -m "Description of your feature"
  1. Push to the branch:
git push origin feature-name
  1. Open a pull request detailing your changes.

Please ensure your code follows our Code of Conduct and adheres to the contribution guidelines.

Screenshots

Home Screen

image

Playing the game

image

image

Getting BlackJack (Exactly 21)

image

Busted (Going over 21)

image

Winning

image

About

Simple CLI BlackJack Application. Simulates playing the game in real life without the risk of losing all your money.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Languages