This project simulates and analyzes different strategies for playing the "Close Out" dice game, a game where players aim to accumulate points for numbers 1-6 until they are all "closed out."
- Players can choose to roll either 1 die or 3 dice on their turn
- When rolling 1 die, each roll is worth 3 points
- When rolling 3 dice, each roll is worth 1 point
- A number is "closed out" when it accumulates 3 points
- The game ends when all numbers (1-6) are closed out
- The goal is to complete the game in the fewest possible turns
The simulator compares four different strategies:
-
One Die Strategy (
one_die
)- Always rolls a single die for 3 points per roll
-
Three Dice Strategy (
three_dice
)- Always rolls three dice for 1 point per roll
-
Mixed Strategy (
mixed
)- Randomly chooses between rolling one die or three dice each turn
-
Hybrid Strategy (
hybrid
)- Starts with one die for the first few turns
- Switches to three dice for the remainder of the game
- Single game simulation with detailed turn-by-turn analysis
- Bulk simulation of thousands of games to generate statistics
- Strategy comparison metrics including:
- Average turns to completion
- Median turns
- Minimum and maximum turns
- Standard deviation
- Head-to-head competition results
To run the basic simulation:
python simulation.py
To debug a single game with detailed output:
python simulation_debug.py
game.py
- Core game logic and mechanicssimulation.py
- Main simulation and analysis codesimulation_debug.py
- Detailed single-game debugging tool
The simulation provides detailed statistics for each strategy, including:
- Win rates in head-to-head competition
- Average number of turns to completion
- Variability in game length
- Optimal strategy identification
This tool is useful for:
- Understanding game dynamics
- Testing and comparing different strategies
- Identifying optimal play patterns
- Analyzing game balance and mechanics
Mitchell Swaney
- GitHub: @SwaneyStudios