How Next Battleship Move Works
The Bayesian Probability Matrix, Combinatorial Placement Engine, and Parity Algorithms
1. The Bayesian Probability Density Function (PDF)
Unlike deterministic games with complete information (like Checkers or Connect 4), Battleship is an imperfect-information game governed by fog of war. Players cannot observe where the opponent placed their fleet.
To achieve mathematically optimal play, our engine computes a Probability Density Function (PDF) for every square on the 10×10 board:
Whenever you mark an ocean tile as 🌊 Miss or 💀 Sunk, all ship placement permutations intersecting that coordinate become mathematically illegal. When you mark a 🔥 Hit, permutations that cover the hit surge in weight, focusing firing solutions around the wounded vessel.
2. The Visual Heatmap: Dark Green to Fiery Red
Raw probability matrices are hard for human players to visualize under match conditions. Our solver converts the continuous mathematical density into a high-contrast visual heatmap:
Dark Green (Low Odds)
Sub-10% density. Edge sectors or constrained pockets where few remaining ships can legally fit.
Bright Yellow (Medium Odds)
20% – 45% density. Central hunting sectors with wide open water lanes in both cardinal directions.
Fiery Red (Peak Heat)
70% – 95%+ probability. Tiles orthogonal to active hits or along verified collinear damage vectors.
3. Dynamic Parity Hunting: Sinking the Destroyer
The fundamental theorem of Battleship hunting states that you do not need to search every square to find every ship. Because every ship is contiguous, testing a grid spaced by the length of the smallest remaining ship guarantees intersecting every enemy vessel.
- Fleet Phase 1 (Destroyer Alive, length 2): Firing on alternating checkerboard tiles (50 total shots maximum) guarantees hitting all ships.
- Fleet Phase 2 (Destroyer Sunk, min length 3): Firing with 3-cell diagonal spacing reduces maximum hunting shots from 50 to 34!
- Fleet Phase 3 (Cruiser & Sub Sunk, min length 4): Firing with 4-cell spacing reduces maximum shots down to 25!
Our Enemy Fleet Tracker automatically removes sunk ships from the simulation, causing the parity grid to instantly recalibrate.
4. Target Mode: Collinear Lineal Probing
Once an initial hit 🔥 is registered, the solver switches from Hunt Mode to Target Mode:
- Single Hit: Tests the 4 orthogonal neighbors (North, South, East, West). Diagonals are strictly ignored because Battleship vessels cannot lie diagonally.
- Two Collinear Hits: If hits are registered at
C4andC5, the ship is proven to be horizontal. The engine assigns zero weight to vertical probes and maximizes density atC3andC6. - Ship Sunk Confirmation: Once the final hit sinks the vessel, the coordinates are marked 💀 Sunk, and the engine seamlessly returns to open-ocean hunting for the remaining fleet.