A fair naval search where the computer hunts the same way you do
Sink the Fleet is a classic naval guessing game played against the computer on a pair of eight-by-eight grids. Five ships are hidden on each grid, and you take turns firing at squares. A hit is marked red, a miss blue, and the first player to sink all five of the other side's ships wins. The computer does not cheat: it fires blind until it hits something, then works around that hit using the same logic a human player would. Your best score is the fewest shots it takes to win, and the strategy that produces it is surprisingly systematic.

Setup and the two grids
Two grids appear on the screen. The top grid is their sea, where the computer's five ships are hidden. The bottom grid is your sea, showing your own ships and the squares the computer has fired at. You click squares on the top grid to fire. The bottom grid updates automatically after each of the computer's turns.
Each fleet has five ships of different sizes. The largest is a carrier at four squares long. Two ships, a cruiser and a submarine, are three squares long each. Two smaller vessels, a destroyer and a patrol boat, are two squares long each. That gives a total of fourteen ship squares scattered across the sixty-four-square grid. Every ship sits in a straight line, either horizontal or vertical, and no two ships touch each other, not even at the corners. That spacing rule is important because it means the squares around a sunk ship are guaranteed empty, and you can skip them.
How a turn works
Click any square on the top grid that you have not already fired at. The square lights up red if you hit a ship, or blue if you missed. Sound cues tell you the result as well: a sharp tone for a hit, a deeper tone for a miss, and a longer note when you sink a ship entirely. After your shot, the computer fires at one of your squares and the bottom grid updates.
A ship is sunk when every one of its squares has been hit. The game announces which ship was sunk by name. Once all five ships on one side are gone, the round ends. If you sank their fleet first, your score is the total number of shots you fired. The fewer the shots, the better.
Scoring and what makes a good result
Your score is counted in shots fired to sink all five enemy ships. The game tracks your best across sessions, stored in your browser on this device and never sent anywhere. Lower is better, and the number gives you a direct measure of how efficient your search was.
A perfect game with no wasted shots is extremely unlikely, because you must find the ships before you can sink them. But the gap between a random player and a methodical one is large. Random firing on a sixty-four-square grid takes an average of well over forty shots to find everything. A player using the right search pattern can consistently finish in the low thirties.
Strategy: the chequerboard search pattern
The single most effective search technique is to fire in a chequerboard pattern. Because the smallest ship is two squares long, every ship must cover at least one square of each colour on a chequerboard. That means checking every other square is enough to find every ship, and you only need to search half the board.
Start by imagining the grid coloured like a chessboard, with alternating light and dark squares. Fire only at one colour until you get a hit. This halves the number of search shots you need and is the reason good players finish in far fewer shots than random guessers. Once you have cleared one colour you know any ship not yet found must span two squares of the other colour, but you will almost certainly have found everything before that point.
Strategy: following up a hit
When you hit a ship, stop searching and start sinking. Ships sit in straight lines, so the rest of the ship is directly above, below, left or right of the hit. Fire at the four squares around the hit, one at a time, until you get a second hit. Once you have two hits in a line, follow that line in both directions until you miss on each end. Then count the hits: if they add up to the ship's length, it is sunk.
A half-found ship is a wasted opportunity. Every square you fire at while a damaged ship is still afloat is a shot that could have been finishing it off. Discipline in following up hits is the difference between a thirty-shot game and a forty-five-shot game. If you lose track of which direction you were working, look at the red squares on the grid and continue the line. When you reach a miss in one direction, reverse and try the other end of the line. A three-square ship needs three hits in a row along a straight line, and you should not return to searching until all three are found.
Strategy: using the no-touching rule
Ships in this game never touch each other, not even diagonally. That means every square adjacent to a sunk ship, including the four corners, is guaranteed to be empty water. You do not need to fire at those squares and doing so wastes a shot.
After you sink a ship, mentally mark all the squares around it as empty. On a crowded board this can eliminate six or eight squares from your search in one go. The effect compounds: each sunk ship clears a buffer zone that narrows down where the remaining ships can be. Late in the game, when only one or two ships remain, the buffer zones often leave very few squares that could still hide anything.
How the computer plays
The computer uses the same two-phase approach a skilled human would. In its search phase it fires at random squares on a chequerboard pattern, checking only every other square to cover the grid efficiently. When it gets a hit it switches to a hunt phase, targeting the four squares around the hit. If it finds a second hit in a line, it works along that line in both directions until the ship is sunk.
Importantly, the computer does not know where your ships are. It fires blind until it finds something, and then it reasons from the hit pattern. This is not a pretence of fairness. The code genuinely does not read your grid until it fires at a square and gets told whether it hit. If you want proof, notice that the computer sometimes misses several times in a row even when a ship is in a cluster of squares it has already been near.
Common mistakes and how to improve
The most common mistake is firing at random without a pattern. Random shots waste half the board on squares that a chequerboard search would skip entirely. Adopt the chequerboard habit and your shot count drops immediately.
The second mistake is leaving a hit without following it up. A single red square on the enemy grid that is not surrounded by more shots means you found a ship and walked away. Go back and check the four neighbours before resuming your search pattern.
A third mistake is firing next to a sunk ship. Once a ship is fully sunk, its neighbours are all water. Shooting into that buffer zone adds to your shot count without providing any new information. Keep track of which ships have been announced as sunk and skip the squares around them.
Privacy and how the game runs
The entire game runs inside your browser tab. Both fleets are generated locally, every shot is resolved locally, and the computer's hunt logic runs on your own processor. Nothing is uploaded, there is no account, and your best score stays in local storage on this device. Once the page has loaded it works offline, so you can play a full naval campaign on a train or a plane with no connection at all.
The board scales to your screen and the controls are sized for touch, so the game works on phones and tablets as well as desktops. Because there is no server, the computer genuinely cannot know where your ships are until it fires and the code checks the result. The game is a fair contest of search patterns and follow-up logic.
