Skip to content
Vuk Cvetković
GamesBuilt:

BattleshipsBeta

Hide five ships, then find theirs before they find yours. Shots alternate one at a time, and the opponent you pick is the whole of the difficulty: the weakest fires wherever it has not fired yet, and the strongest counts every position your fleet could still be in and shoots the square that appears in most of them.

Choose your opponent

Fires at random. About 95 shots to clear a board, so losing to it takes real effort.

Shots0
Fewest shots-
To place5

Their waters

  1. Carrier5
  2. Battleship4
  3. Cruiser3
  4. Submarine3
  5. Destroyer2

Your fleet

Their fleet is down

All five sunk, and yours got there first.

Your fleet is down

Their ships are shown where they were standing, so you can see what you were looking for.

Your fleet is already at sea. Press a ship to pick it up, press the water to put it down, and turn it before you do. Press a square in their waters to fire. Arrow keys walk a board, Enter fires, and R turns a ship while you are placing one.

How to play

  1. Put five ships in the water

    A fleet is dealt for you the moment the page opens, so you can start straight away. Press a ship to pick it up, turn it, and press a square to set it down. Ships are allowed to touch, which is the standard rule and the one that gives less away.

  2. One shot each, in turn

    A hit does not buy a second shot, on either side. You fire first, the opponent answers, and the game is over as soon as one fleet has all seventeen of its squares hit.

  3. A hit is a thread to pull

    Something is there and it runs one of four ways. Two hits in a line settle the direction, and the ends of that line are the only squares still worth anything until the ship goes down.

  4. Pick who you are playing

    The sailor takes about ninety-five shots to clear a board, the gunner fifty-five, the captain fifty and the admiral forty-five. Seventeen is the floor. Your best is kept separately for each of them, because a win against one of them is not a win against another.

How it is built

No canvas and no game library, like the rest of them. The sea is a grid of buttons and the fleet is a layer over it: one element per ship, spanning its squares, with a drawing inside it. A carrier has a flight deck, an island and markings, a submarine sits low with nothing on deck at all, and none of that survives being cut into squares - so a hull is one shape across its whole length rather than a rounded end stuck on each square. Each vessel is drawn twice over: the full plan, with its turrets and funnels and flight deck, and the outline alone. The outline is what the copies stacked underneath a hull use to give it a side, so the detail is resolved once per ship rather than eight times. A ship laid the other way is the same drawing turned a quarter.

The board is tilted and the ships stand off it, and both are real rather than drawn. The chart is rotated in three dimensions and the fleet is lifted along the axis that rotation leaves, so a hull is above its own shadow and turns its side with it when it turns. There is no perspective anywhere, deliberately: a vanishing point would make the far edge narrower than the near one, and a grid you name squares on cannot afford to have its columns stop being parallel. A shot is drawn too, crossing from one of your own hulls to the square it lands on, because a turn here is one fleet firing at another rather than a mark appearing.

The opponent cannot see the fleet it is shooting at, and that is structural rather than a promise made in a comment. The function that picks a square takes two things: the record of its own shots, and the lengths of the ships still afloat. The layout is not in scope where the decision happens, so there is no line to be careful about. Which ship sank is public, the same way a player says it out loud, and it is what lets the reasoning narrow.

The strongest of the four does not guess. For every ship still afloat it walks every position that ship could occupy, drops the ones a miss or a wreck has ruled out, and adds a vote to each unknown square the survivors cover. The heaviest square is the shot. Hunting and following up a hit are the same calculation rather than two modes: with nothing unexplained it produces the familiar bell over the middle of the board, and with a hit on the table the positions that fail to account for it are dropped and the weight collapses around it.

Following up a hit is usually written as a queue of squares to try, and that queue is where this kind of program goes wrong: it has to be weeded every time a ship sinks, every time another shot resolves one of its entries, and every time two ships lie alongside each other. Here the follow-up squares are worked out from the board every turn, so there is nothing to keep and nothing to go stale. Four opponents, forty thousand simulated games against an independently written defender, and not one illegal shot between them.

Esc