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:

P(Cell = Ship | History) = Σ [ Valid_Placements(Ship_k covering Cell) × Weight(Active_Hits) ] / Total_Valid_Placements

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.

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:

  1. Single Hit: Tests the 4 orthogonal neighbors (North, South, East, West). Diagonals are strictly ignored because Battleship vessels cannot lie diagonally.
  2. Two Collinear Hits: If hits are registered at C4 and C5, the ship is proven to be horizontal. The engine assigns zero weight to vertical probes and maximizes density at C3 and C6.
  3. 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.