■

■

Battleship against the computer

Play Battleship online against the computer: hunt down the enemy fleet before it finds yours. Free, no sign-up, in the browser or on a phone.

What this game is

Battleship is not a game about luck, it is a game about information. Every shot, misses included, tells you something new, and the only question is whether you know how to use it.

Your fleet is on the left, the enemy waters on the right, and about them you initially know nothing. Twenty cells out of a hundred hold ships, and hunting for them at random can take a very long time. But ships never touch, every ship's length is known, and a miss marks a cell permanently — the whole strategy grows out of those three facts.

A game is usually decided before the first hit, by how you searched. A good search pattern saves a dozen shots, and a dozen shots here is half the game.

Rules

How to play better

A bit of history

Battleship began as a pencil-and-paper game in the early twentieth century. It was drawn in notebooks and pads from around the time of the First World War, and in the 1930s various publishers started selling it as printed pads with the grids ready-made.

In 1967 Milton Bradley released the plastic board version — the briefcase with the upright boards and the little pegs. That is the form in which most of the world knows the game.

The board on this page follows the other, notebook tradition, the one played at a school desk: a 10×10 grid, a fleet of one four-decker, two three-deckers, three two-deckers and four single cells, ships forbidden to touch, and a hit earning another shot. In the Russian interface the columns are lettered А to К.

The program itself follows the Battleship applet that ran on this site from 2005: the same cyan panel, the same old-fashioned menu bar and the same grey flash on a cell before the computer fires.

About the levels

What all three share: the computer sees exactly what you would see in its place — the grid of misses, hits and sunk ships, plus the list of lengths still afloat. It never looks at your layout, on any level. It also places its own fleet at random regardless of the difficulty you pick.

Easy fires at a random unknown cell. After a hit it picks one of its wounded cells at random and shoots a random neighbour of it. It has neither a net nor a sense of direction: even when two hits in a row make the ship's orientation obvious, it may go on poking around at random.

Hard does collect hits into connected runs. A run of two or more gives it the axis and it shoots one of the two ends. While hunting it uses a parity net: only cells whose coordinates add up to a multiple of the smallest ship still afloat. But while a single one-decker is afloat the smallest ship is one cell long and the net is the whole board; it can only thin out at the very end. So in practice it hunts at random: it never works out where a big ship can still fit.

Expert counts probability density. For every ship still afloat it enumerates all of its possible placements, discards the ones that contradict what it knows, and lets each survivor vote for the cells it covers. The shot goes to the cell with the most votes. A placement that explains a wounded deck weighs two hundred times more for each such hit covered — which is what turns the hunt into a chase along the ship's axis with no separate targeting mode at all.

Expert has one weakness, but a genuine one: when it discards impossible placements it looks only at water and sunk ships. It does not apply the no-touching rule around a wounded ship, so it seriously considers placements pressed up against something it has already hit. In practice that costs it almost nothing: the weight on a wounded deck already keeps it from firing beside the ship.

Where to go from here