Skip to content

About

Simulating hands in blackjack and seeing which strategy is best for each hand. Following how closely the model follows the known basic strategy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Blackjack Simulation

A small Java program that simulates blackjack hands under four fixed strategies (Always Hit, Always Stand, Always Double, Always Split) and reports how much of a starting bankroll each one ends with.

Why

Made this out of curiosity about blackjack basic strategy, and wanting to see how a ruleset like "perfect" basic strategy actually gets worked out from simulation rather than taken on faith.

What it does

  • Builds a shuffled shoe of a given number of decks.
  • Deals a player and dealer hand from the shoe for each simulated round.
  • Plays out the round according to whichever fixed strategy is being tested, no player decisions, the strategy is baked in.
  • Has the dealer hit until reaching 17 or more, the standard house rule.
  • Tracks the running bankroll across all simulated rounds for each strategy and prints the final totals.

Requirements

Just a JDK (11+ is fine) on your PATH, no external dependencies or build tool. javac and java on Windows/Linux/Mac all work the same way here.

Running it

javac Blackjack.java
java Blackjack

It will prompt for the shoe size in decks and the number of simulations to run, then print the final bankroll for each of the four strategies.

Date

Worked on in December 2024.

About

Simulating hands in blackjack and seeing which strategy is best for each hand. Following how closely the model follows the known basic strategy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages