The Strategy of Battleship

2.3k Views Asked by At

Battleship is a children's two-player game where each player places different sized "ships" on a grid (usually 10*10) of squares. Players then take turns "firing" at one square on their opponent's grid, in an attempt to hit their opponents ships. The game ends when all of one player's ships are "sunk" or hit on every space they occupy.

When playing the standard version as a board game, the ships consist of lengths $\{2,3,3,4,5\}$, and can be placed anywhere as long as they don't overlap. A relatively good strategy is to call every other square, essentially checkerboarding the grid and calling either only the squares of one color. This works because every ship is at least of length $2$, so finding the ships becomes a significantly easier process.

However, when using the iMessage app Game Pigeon, the layout is slightly different. On their 10*10 grid, the ships have lengths of $\{1,1,1,1,2,2,2,3,3,4\}$. Additionally, two ships are not allowed to be placed so that they are next to each other, either orthogonally or diagonally. The strategy for this game becomes more difficult to decipher, as there are both ships of length $1$ and additional placement rules. Is there a way to determine how to guess well in this version, too? And can it be proved to be optimal?

1

There are 1 best solutions below

2
On

I bet the optimal strategy for this game would be fairly complex, and nearly impossible to prove to be optimal, unless you brute-force it with a computer.

But, as a general strategy I would first hunt for the ship of length $4$, and I would hunt for those in a similar way you hunt for ships of $2$, but now instead of skipping every one square, you skip every $3$ squares, i.e. something like this:

\begin{array}{|c|c|c|c|c|c|c|c|c|c|} \hline &&&*&&&&*\\ \hline &&*&&&&*\\ \hline &*&&&&*&&&&*\\ \hline *&&&&*&&&&*\\ \hline &&&*&&&&*\\ \hline &&*&&&&*\\ \hline &*&&&&*&&&&*\\ \hline *&&&&*&&&&*\\ \hline &&&*&&&&*\\ \hline &&*&&&&*\\ \hline \end{array}

I think this would be a pretty good strategy, because it really pays off to get a hit anywhere on the board: with any hit you can immediately remove the squares diagonal from the hit as any possible ship parts because of the constraint of ships not being to touch each other. Thus, it behooves you to get hits as fast as possible, and with this pattern you are bound to hit part of that ship of length $4$.

Also as a general strategy I would try to guess squares that are not on the side of the board before guessing any that are on the side, again because a hit that's not on the side is more 'productive' (you can cross off more squares) than a hit on the side.

Also, once you can cross off a good number of squares of the board as water, the possible placements of the two ships of length $3$ will quickly be limited as well. You might be able to follow a similar pattern to ensure you quickly hit on one of those ships, though the optimal nature of those follow-up patterns will quickly depend on whatever weird shape of unresolved squares are left, and this is exactly why I don't see any 'clean' or 'simple' algorithm forthcoming, let alone any kind of proof of optimality. Yikes!