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.
- Play classic Blackjack against the computer.
- Simple and intuitive command-line interface.
- Java Development Kit (JDK) 17 or higher
- Clone the repository:
git clone https://github.com/yourusername/BlackJack-Game.git
- Navigate to the project directory:
cd BlackJack-Game
- Compile the Java files:
javac -d bin src/com/yourusername/blackjack/*.java
Run the game using the following command:
java -cp bin com.yourusername.blackjack.Blackjack
-
'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).
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.
We welcome contributions to this project!
To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Make your changes and commit them:
git commit -m "Description of your feature"
- Push to the branch:
git push origin feature-name
- Open a pull request detailing your changes.
Please ensure your code follows our Code of Conduct and adheres to the contribution guidelines.