Go to file
2026-06-13 23:15:03 +02:00
gui bug fix 2026-06-13 23:01:43 +02:00
images init commit with project version 1.0 2026-06-09 20:07:08 +02:00
static quick fix for buttons on decision 2026-06-13 23:15:03 +02:00
.dockerignore web deployment changes 2026-06-11 20:10:52 +02:00
.gitignore Initial commit 2026-06-09 17:53:27 +00:00
api.py web deployment changes 2026-06-11 20:10:52 +02:00
blackjack_game.py init commit with project version 1.0 2026-06-09 20:07:08 +02:00
constants.py init commit with project version 1.0 2026-06-09 20:07:08 +02:00
docker-compose.yml web deployment changes 2026-06-11 20:10:52 +02:00
Dockerfile web deployment changes 2026-06-11 20:10:52 +02:00
game_logic.py init commit with project version 1.0 2026-06-09 20:07:08 +02:00
main.py init commit with project version 1.0 2026-06-09 20:07:08 +02:00
README.md update readme 2026-06-10 12:02:36 +02:00
requirements-web.txt web deployment changes 2026-06-11 20:10:52 +02:00
requirements.txt add proper requirements.txt 2026-06-09 21:03:59 +02:00

Blackjack Theory Trainer

A desktop application for learning and practicing basic blackjack strategy. Built with Python and customtkinter, it drills you on the mathematically optimal play for every hand based on the dealer's upcard.

Features

  • Interactive practice — dealt random hands, you choose Hit, Stand, Double, or Split
  • Instant feedback — every action is evaluated against basic strategy with an explanation
  • Scenario tracking — decisions are categorized into hard totals, soft totals, and pairs
  • Statistics — track your accuracy and longest correct streak
  • Streak notifications — get notified when you lose a streak of 3+
  • Visual card display — rendered card images for a realistic feel
  • Dark mode UI — easy on the eyes during extended sessions

Tech Stack

  • Python 3.10+
  • customtkinter — modern, themed tkinter widgets
  • Pillow — card image rendering

Getting Started

# Clone the repository
git clone https://git.kampmeierdev.com/kampmeierdev/blackjack-theory-game.git
cd blackjack-theory-game

# Create and activate a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the application
python main.py

Usage

  1. You are dealt two cards (the dealer shows one upcard).
  2. Classify your hand and click the correct action.
  3. Green feedback = correct play; Red feedback = mistake with an explanation.
  4. Click Next Round to continue.
  5. Use the Hint button if you are unsure.
  6. Close the window to view your final session statistics.

Project Structure

blackjack-theory-game/
├── gui/
│   ├── components/       # UI subcomponents (cards, buttons, hints, stats, notifications)
│   ├── gui.py            # Main GUI application window
│   └── utils.py          # Image loading utilities
├── images/cards/         # Card sprite PNGs
├── blackjack_game.py     # Game state and statistics
├── constants.py          # Suits and ranks
├── game_logic.py         # Card dealing, hand evaluation, basic strategy rules
├── main.py               # Entry point
└── requirements.txt

Basic Strategy Reference

The decisions implemented in this trainer follow standard blackjack basic strategy for a multi-deck game where the dealer stands on soft 17 (S17) and doubling after splitting (DAS) is allowed. Notable rules:

  • Hard totals: Stand on 17+, hit on 1216 vs dealer 7+, double on 11 always
  • Soft totals: Double A,6A,7 vs dealer 36; stand on A,8+
  • Pairs: Always split Aces and 8s; never split 5s or 10s