Skip to content

AndrewDant/ShutTheBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shut the Box Simulator

Simulates a large number of plays of the game Shut the Box using different strategies, generating and saving data about the outcomes of each game (essentially Monte Carlo experiments). Data Analysis to interpret the results of the experiments, comparing factors like the impact of strategy choice on score distribution.

Game Rules (10 paddle variant)

Shut the Box is a dice game of luck and decision making. The player starts the game with 10 paddles numbered 1 through 10 all up, ready to be used. Each turn the player rolls two dice (sometimes only one) and adds the rolls together to get a sum. Then they must knock down paddles that add up to the sum. Eg if a 7 is rolled they could knock down the 7, or the 1 and 6, or the 5 and 2, etc. Once a paddle has been knocked down it cannot be used again for the rest of the game. The game ends if all paddles are knocked down (known as "shutting the box") or when they roll a sum which they cannot match with their remaining paddles. The player's score is equal to the sum of the remaining paddles, with 0 being a perfect score. Additionally, once the 7, 8, and 9 paddles are knocked down the player switches to rolling one die each turn instead of two, even if the 10 is still up.

Steps

  1. Writes some steps
  2. Simulate a Single Game with the simplest strategy
    • Write high level pseudocode
    • pseudocode for helper functions
    • implement and test the helper functions
  3. Save game data to the disk
    • Need to think about what I care to save. Better too much than too little but could start simple
    • pick a format. Probably CSV
    • One table or multiple?
  4. Update the code to simulate an arbitrary number of games
    • constant value or command line input the number
    • probably just a for loop over the step two code
  5. Define multiple game strategies and update the game simulator to use a chosen one
  6. Write steps for EDA
  7. Start with a separate .ipynb file
  8. import the json data
    • read the file into memory
    • convert it into a pandas DataFrame
  9. basic descriptive statistics for score, including grouping by strategy, first roll
  10. add graphs comparing score distributions for different strategies
  11. normalize first roll histograms

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors