Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ondrejhruby/blackjack

Command-line Blackjack game implemented in Python, where players can test their luck and strategy against a computer dealer. The game follows classic Blackjack rules, allowing players to hit, stand, and try to reach 21 without busting.
https://github.com/ondrejhruby/blackjack

blackjack blackjack-game card-game command-line-game console-game game-development game-logic interactive-game object-oriented-programming oop python python-game randomization terminal-game

Last synced: about 1 month ago
JSON representation

Command-line Blackjack game implemented in Python, where players can test their luck and strategy against a computer dealer. The game follows classic Blackjack rules, allowing players to hit, stand, and try to reach 21 without busting.

Awesome Lists containing this project

README

        

# Blackjack Game

A simple command-line Blackjack game implemented in Python. This game allows players to experience the excitement of Blackjack, competing against a computer dealer with classic rules. Test your strategy, try to reach 21, and avoid going bust!

## How to Play

1. **Start the Game**: Run the game using Python in your command line or terminal.
2. **Gameplay**:
- You start with two cards, and the dealer shows one card.
- You can choose to "Hit" to draw another card or "Stand" to keep your current hand.
- The goal is to get as close to 21 without exceeding it.
- The dealer will reveal its cards after the player stands and will draw cards until reaching 17 or higher.
3. **Winning Conditions**:
- If your hand is closer to 21 than the dealer's without exceeding 21, you win.
- If your hand exceeds 21, you go bust and lose.
- If the dealer goes bust, you win automatically.

## Features

- Simulates a classic Blackjack game with standard rules.
- Allows player decisions to "Hit" or "Stand" during gameplay.
- Automatically handles dealer logic according to Blackjack rules.

## Requirements

- Python 3.x

## How to Run

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

## Skills Learned

- **Python Basics**: Use of variables, conditionals, loops, and functions.
- **Object-Oriented Programming (OOP)**: Implementing classes and methods for game logic.
- **Game Logic Implementation**: Managing game states, player decisions, and winning conditions.
- **Randomization**: Utilizing Python’s random library to simulate card drawing.
- **User Interaction**: Handling user input through the command line and providing dynamic feedback.
- **Problem-Solving**: Structuring the game flow and implementing Blackjack rules.

## Contributing

Contributions are welcome! Please fork the repository, create a branch for your feature or bug fix, and submit a pull request.

#