Skip to content

A simple CLI app to help you play smarter Blackjack. Just enter your cards and the dealer’s up-card, and the app tells you whether to hit, stand, or take another action!

License

Notifications You must be signed in to change notification settings

JerryShum/blackjack-cli

Repository files navigation

Blackjack Strategy CLI 🃏

A command-line tool for practicing and using Basic Blackjack strategy. Enter the dealer’s up-card and your hand, and the program will suggest the optimal move (Hit, Stand, Double, etc.). Perfect for learning or sharpening your skills at the table!

Features 📊

  • Validates player and dealer card input
  • Suggests optimal Blackjack actions based on strategy rules
  • Supports repeated Hit cycles, recalculating the best move each time
  • Continuous rounds until you choose to quit
  • Clean and colorful CLI interface using colorama

Installation 📦

This project uses uv as its package manager. If you don’t already have it, install uv by following the official instructions.

Clone the repository and install dependencies:

git clone https://github.com/jerryshum/blackjack-cli.git
cd blackjack-cli
uv sync

This will create and manage a virtual environment for you and install all dependencies declared in pyproject.toml.

Usage

Run the app with:

uv run python main.py

Example interaction:

Dealer Card (The card that the dealer shows): K
Player Cards (The cards that the player has): 10 2
-------------------------------------------------------------------------
Suggested Action: Hit
🤔 Since we suggested you to hit again, would you like to input your new card? (y/n)

Roadmap 🗺

  • Expand support for special rules (e.g., Splits)
  • Improve error handling for unexpected input
  • Add strategy table reference in documentation

License

This project is open-source under the MIT License.

About

A simple CLI app to help you play smarter Blackjack. Just enter your cards and the dealer’s up-card, and the app tells you whether to hit, stand, or take another action!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages