Broadside

Broadside

A Battleship engine that weighs every fleet that could be hiding before it takes a shot.

Version 0.1.0. Free, fully open source, and it runs offline.

A real game by the engine, replayed.

The strongest Battleship engine we know of

Most Battleship bots estimate where the ships might be. Broadside is exact: before every shot it weighs every fleet that could still be hiding, it plays the endgame out, and it learns how its opponent plays. We haven't found another engine that does all three, or one that sinks a randomly placed fleet in fewer shots.

44shots on average to sink a randomly placed fleet. The classic probability-density bot needs 44.8; the best possible is 17.

30 billionfleet layouts, weighed exactly before every shot.

7 in 10games won against a careful, human-style player.

How it was measured, game by game(opens in a new tab)

Download

The terminal version. Play against the engine, let it call your shots in a game against someone else, or run your own experiments. One file, nothing to install.

See all downloads
Other systems

Then run it

./broadside play --heat
./broadside assist

play is a game against the engine; --heat shows where it expects your ships. assist tells you where to fire in a game against anyone else.On Windows, use broadside.exe.

On a Mac, the first launch is blocked because the app isn't signed with an Apple developer ID. Allow it in System Settings under Privacy & Security.

How it works

It counts every fleet

Most bots guess where ships might be. Broadside counts every layout that fits the hits, misses and sinkings so far, exactly, and fires where a ship is most likely.

It plays the endgame out

When few enough layouts remain, it plays each candidate shot to the end in every one of them and picks the shot that finishes fastest.

It learns how you play

Over a session it learns where you like to hide ships and which waters you search last, so the games get harder the longer you play.

Read the full method and every measurement on GitHub(opens in a new tab)

Ready for a game?

Place your fleet, win the coin toss, and fire. It runs entirely in your browser; nothing is sent anywhere.