How to Win at Battleship — Probability + Parity Strategy

How to Win at Battleship — Probability + Parity Strategy

Battleship is mostly a probability game. Random clicking wins ~60-80 shots; optimal play wins in 35-50 shots. Here’s the algorithm that elite players use.

Phase 1: Hunt (looking for ships)

Don’t fire randomly. Use parity search: only fire at cells where (row + column) is even. This guarantees that you’ll hit every horizontal/vertical ship of length 2+ within about 50 shots.

Why parity works: every ship of length 2 must occupy at least one cell where (row + col) is even AND at least one where (row + col) is odd. So checking only even cells guarantees a hit somewhere on every 2-cell ship.

Phase 2: Target (after a hit)

Once you hit something, switch to target mode. Fire at the 4 cells immediately adjacent: up, down, left, right. (Diagonal cells don’t matter because ships can’t be diagonal.)

If your next hit reveals the ship’s orientation, fire along that line until you sink it. If your next 4 shots all miss, the ship was length-2 and you sunk it on the original hit. Mark and move on.

Phase 3: Sink (confirm and clean up)

When a ship is sunk, the opponent confirms which ship it was (Carrier 5, Battleship 4, Cruiser 3, Submarine 3, Destroyer 2). Now you know the size of remaining ships.

If only the Carrier remains, you only need to hunt for 5-cell-long lines. Switch from parity-1 to parity-5: only fire at cells you’d be checking for a 5-cell ship. This is roughly every 5th cell.

Probability-based heuristic

Top players don’t think in fixed phases. They calculate, for each unrevealed cell, the probability that ANY ship occupies it. Then fire at the highest-probability cell.

Probability formula (simplified): for each remaining ship, count the number of positions it could occupy that include this cell. Sum across ships. The cell with the highest sum is your best shot.

Edge and corner traps

Corners are less likely to contain ships than centre cells. A ship of length 5 in a corner can only point in 2 directions (right or down for the top-left corner); the same ship in the centre has 8 orientation-options.

So: fire centre first, edges last. This raises your hit rate by ~15% compared to spiral patterns.

Pre-game: ship placement strategy

If you’re placing ships, the optimal counter-strategy is: mix orientations (don’t make all ships horizontal or all vertical), avoid clustering (a parity search hits clusters fast), and use edges occasionally (humans hunt centre first; bots use parity).

Practice

Play our Battleship. Our AI uses parity search + target mode. Beat it consistently and you’re playing near-optimally.

Related reading

Related guides