Skip to content

About

Optimizing the Card-Flip Strategy in Pokémon SoulSilver

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Voltorb Flip Optimizer

A small helper for the 5x5 Voltorb Flip puzzle that enumerates all valid boards given row/column sums and bomb counts, computes exact posterior probabilities P(0/1/2/3) and expected values (EV) for each unopened cell, and recommends the cell with the lowest probability of being a bomb.

Key features

  • Exact enumeration of all boards consistent with provided constraints.
  • Per-cell posteriors and EV calculation using DFS and pruning.
  • Recommends the safest next cell (min P(0), tiebreaker: max EV).
  • Interactive CLI to step through a game.

Quick start

  1. Inspect the main implementation and helpers in voltorb.py:

  2. Run interactively:

python voltorb.py

Follow prompts to enter 5 row sums, 5 row bomb counts, 5 column sums, and 5 column bomb counts. The program verifies basic consistency (e.g. total sums and bomb counts) before enumerating solutions.

Constraints (mathematical)

  • Total sum constraint: $\sum_{r=0}^{4} \text{row\_sums}[r] = \sum_{c=0}^{4} \text{col\_sums}[c]$
  • Total bombs constraint: $\sum_{r=0}^{4} \text{row\_bombs}[r] = \sum_{c=0}^{4} \text{col\_bombs}[c]$
  • Each non-bomb cell ∈ {1,2,3} so per-row/column sums must be achievable given non-bomb counts.

Notes on implementation

  • The solver generates all possible length-5 row patterns that meet row sum/bomb constraints (see _enumerate_row_patterns) and then composes full boards row-by-row while pruning using column partial bounds (see _col_bounds_so_far inside the file).
  • Because the board is fixed at 5×5, exhaustive search with pruning is practical and yields exact probabilities.

When to use

  • Use this tool when you want an exact probabilistic recommendation (not a heuristic) for the next flip in Voltorb Flip given full row/column constraints and any already-opened cells.

Contributing

  • Improvements welcome: add a small GUI, caching of intermediate results, or optimized pruning heuristics.

License

  • MIT

About

Optimizing the Card-Flip Strategy in Pokémon SoulSilver

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages