Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ondrejhruby/blackjack
- Owner: ondrejhruby
- Created: 2024-09-03T10:00:33.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-03T10:21:54.000Z (4 months ago)
- Last Synced: 2024-09-10T01:19:08.016Z (4 months ago)
- Topics: 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
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.
#