- Flip all the tiles UP
- Roll the dice
- Flip DOWN tiles that add up to total number rolled
- Continue rolling until:
- Last tiles flipped down, player wins
- No combination can be flipped down, player loses
flowchart LR
A[Start<br>All tiles UP]
A --> C[Roll the dice]
C --> D{Can tiles be flipped down to match the roll?}
D -->|Yes| E[Flip DOWN tiles that add up to total number rolled]
E --> G{All tiles flipped down?}
G -->|Yes| H[Win]
G -->|No| C
D -->|No| F[Loss]
def main():
'''
Simulate a game of Shut the Box using different strategies and report the win rate.
'''
iterations = 100_000
stratagies = [random_tiles,
highest_tile,
fewest_tiles,
most_tiles,
expirement,
adaptive_strategy,
prioritize_low_high]
# Run the game for each strategy
for stratagy in stratagies:
print(f"stratagy: {stratagy.__name__}")
wins = 0
for i in range(iterations):
wins += play(stratagy)
# report strategy win rate as a percentage
print(f"Win Rate: {wins / iterations * 100:.2f}%")
# report stratey win rate as number of times you have to play to expect a win
print(f"Win Rate: {1 / (wins / iterations):.0f} games\n")
Google Sheet with form results
I got a bunch of blank plaques from a local auction, and it's not hard to burn stuff on to them. So I'm immortalizing all valid looking submissions (validty 100% my perrogitive) onto a plaque you can also burn at your lesiure.
Here are some useful links for creating a version of the game with a laser cutter and purchasing materials:
Laser Cutter Box Designs from Boxes.PY
- Lots of fine tuning on laser cutter config stuff like kerfs. Not sure if these should be put into the design or kept in configs to handle different material
- Lid is WAY to tall. Could be 10mm (vs. 40mm .) This might add strain on the hunge when it's open on a flat surface though. Consider hinge placement to support opening more than 180d to prevent hinge stress.
- Spacers are key to keeping things from rubbing. Tile box with additional supports needs tiles to be just a smidge narrower so 2 more spaces can fir next to the supports
- Rob holding supports can be smaller/less material. Add more trimming/rounding on upper front corner.
- Fill in the numbers
- Random frog behind the 9 tile was an awesomely awesome accident
- Plex lid needs the supports, just glue is very prone to seperation on box shut. Doesn't need all four - but some way to anchor it vertically is needed if not using glue
- Tile holder should be taller so the back pieces are flush with the top of the bottom box. Original has this, makes tile "grabbing" cleaner
- Overall fit - tight fit makes it difficult to glue with hot glue. Maybe with wood glue this isn't a problem
- Tile holder is too long. The "resting" piece in the front could be moved back quite a bit.
- Lots of design elements burn through to the other side
- Tile width - as above, get width right. Should fit 12 spacers + 2 supports
- Tile height - had to sand a couple to get them to flip w/o scraping the bottom. Lowering the grove would help. I like the height now. Feels right
- Flair: Leaves on corners is good but could be better.
Initial Findings
The tree is already revealing that closing fewer tiles with each roll seems to increase the probability of reaching a winning state in many configurations. However, the model is still running for more exhaustive coverage.
This repository contains the design files for a laser-cut toy, shared under the Creative Commons Attribution-NonCommercial (CC BY-NC) License. Feel free to use and modify the design for non-commercial purposes, but please provide credit.
This design was created using the boxes.py libraries and tools, which are licensed under the GNU General Public License (GPL). Many thanks to the contributors of boxes.py for their work in making these tools available!
To use this design, simply download the files and load them into your laser cutter software. Make any adjustments you like for non-commercial personal use.
This project is licensed under the CC BY-NC License.