# End of piracy and beginning of technology

Blackbeard is no more, and everything seemed peaceful again, but during the last engagement with Blackbeard, my military adviser got introduced to the concept of "computer", and became very interested in its capability and uses.

So it is not a surprised when he led a team of engineers and farmers to build a massive "computer" powered by tons of potatoes. However, its capability is very limited, and it couldn't solve the map. When a standard cryptic map drawn by the scouts is fed into the "computer", it spewed out another map with even more numbers. For example, it would produce a map looking like this:

-----------------------------------------
| 2 |   | 1 |   | 1 |   | 3 |   |   |   |
-----------------------------------------
|   |   |   | 0 |   |   |   |   | 2 | 1 |
-----------------------------------------
| 2 |   |   |   | 1 |   |   |   |   |   |
-----------------------------------------
|   |   | 1 |   |   | 0 |   |   | 3 |   |
-----------------------------------------
|   |   |   |   |   |   |   |   |   | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   |   |   |
-----------------------------------------
|   |   |   |   | 2 |   |   | 1 |   |   |
-----------------------------------------
|   |   |   | 4 |   |   | 1 |   |   | 2 |
-----------------------------------------
| 0 |   |   |   |   |   |   | 0 |   |   |
-----------------------------------------
|   |   |   | 3 |   | 2 |   |   | 2 |   |
-----------------------------------------


The map that was fed in had the standard fleet formation, with 1 flagship of size 4, 2 frigates of size 3, 3 corvette of size 2, and 4 caravel of size 1(I have finally learned the real name of those pesky patrol boats). All of them are placed horizontally or vertically with no ships touching each other, not even diagonally.

My military adviser studied the new map for a bit and concluded that every number on the new map indicates the number of ship pieces adjacent to that number (including diagonally adjacent), and furthermore, no ship pieces is on top of a number.

He smiled at the "computer" and contently walked away, possibly thinking about its uses and improvements. Leaving me with new map of nonsense.

Can you make sense of this new map and figure out the fleet formation?

Note: Although this map was generated by a "computer", no computer is necessary to find the solution.

• Is this essentially a Nurikabe puzzle? – Richard Rast Nov 22 '15 at 2:07
• @RichardRast Nah, note quite, for Nurikabe, the numbers indicate the total number of spaces to be boxed in, so the spaces doesn't have to be beside the number and walls. It is more of a minesweeper. – Yaze Nov 22 '15 at 19:16
• Well, I like it a lot more than Minesweeper (if only because you can actually find the solution...). Love these puzzles! – Richard Rast Nov 22 '15 at 19:54

First, we can exclude all the spaces around the 0s:

-----------------------------------------
| 2 |   | 1 | . | 1 |   | 3 |   |   |   |
-----------------------------------------
|   |   | . | 0 | . |   |   |   | 2 | 1 |
-----------------------------------------
| 2 |   | . | . | 1 | . | . |   |   |   |
-----------------------------------------
|   |   | 1 |   | . | 0 | . |   | 3 | . |
-----------------------------------------
|   |   |   |   | . | . | . |   | . | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   | . | . |
-----------------------------------------
|   |   |   |   | 2 |   |   | 1 |   |   |
-----------------------------------------
| . | . |   | 4 |   |   | 1 | . | . | 2 |
-----------------------------------------
| 0 | . |   |   |   |   | . | 0 | . |   |
-----------------------------------------
| . | . |   | 3 |   | 2 | . | . | 2 |   |
-----------------------------------------

The 2 in the bottom right only has two open spaces next to it, so we can fill those in. We also have some squares in the top left with only one possibility.

-----------------------------------------
| 2 | . | 1 | . | 1 |   | 3 |   |   |   |
-----------------------------------------
| < | > | . | 0 | . |   |   |   | 2 | 1 |
-----------------------------------------
| 2 | . | . | . | 1 | . | . |   |   |   |
-----------------------------------------
| . | . | 1 |   | . | 0 | . |   | 3 | . |
-----------------------------------------
|   |   |   |   | . | . | . |   | . | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   | . | . |
-----------------------------------------
|   |   |   |   | 2 |   |   | 1 |   |   |
-----------------------------------------
| . | . |   | 4 |   |   | 1 | . | . | 2 |
-----------------------------------------
| 0 | . |   |   |   |   | . | 0 | . | ^ |
-----------------------------------------
| . | . |   | 3 |   | 2 | . | . | 2 | v |
-----------------------------------------

The 3 above the 2 in the center requires that there is some part of a ship in the space above and to the left of it:

-----------------------------------------
| 2 | . | 1 | . | 1 | . | 3 |   |   |   |
-----------------------------------------
| < | > | . | 0 | . | ? |   |   | 2 | 1 |
-----------------------------------------
| 2 | . | . | . | 1 | . | . |   |   |   |
-----------------------------------------
| . | . | 1 | . | . | 0 | . |   | 3 | . |
-----------------------------------------
|   | . | . | ? | . | . | . |   | . | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   | . | . |
-----------------------------------------
|   |   |   |   | 2 |   |   | 1 |   |   |
-----------------------------------------
| . | . |   | 4 |   |   | 1 | . | . | 2 |
-----------------------------------------
| 0 | . |   |   |   |   | . | 0 | . | ^ |
-----------------------------------------
| . | . |   | 3 |   | 2 | . | . | 2 | v |
-----------------------------------------

Now the 3 in the top row has only one possibility that works with the 2-1 to its right, and the 3 below those is left with only 3 spaces around it:

-----------------------------------------
| 2 | . | 1 | . | 1 | . | 3 | . | . |   |
-----------------------------------------
| < | > | . | 0 | . | < | x | > | 2 | 1 |
-----------------------------------------
| 2 | . | . | . | 1 | . | . | . | . | o |
-----------------------------------------
| . | . | 1 | . | . | 0 | . | ^ | 3 | . |
-----------------------------------------
|   | . | . | ? | . | . | . | ? | . | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   | . | . |
-----------------------------------------
|   |   |   |   | 2 |   |   | 1 |   |   |
-----------------------------------------
| . | . |   | 4 |   |   | 1 | . | . | 2 |
-----------------------------------------
| 0 | . |   |   |   |   | . | 0 | . | ^ |
-----------------------------------------
| . | . |   | 3 |   | 2 | . | . | 2 | v |
-----------------------------------------

At this point, there is only one possible location for the flagship:

-----------------------------------------
| 2 | . | 1 | . | 1 | . | 3 | . | . |   |
-----------------------------------------
| < | > | . | 0 | . | < | x | > | 2 | 1 |
-----------------------------------------
| 2 | . | . | . | 1 | . | . | . | . | o |
-----------------------------------------
| . | . | 1 | . | . | 0 | . | ^ | 3 | . |
-----------------------------------------
|   | . | . | ? | . | . | . | ? | . | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   | . | . |
-----------------------------------------
|   |   |   |   | 2 | . | . | 1 |   |   |
-----------------------------------------
| . | . | . | 4 | . | . | 1 | . | . | 2 |
-----------------------------------------
| 0 | . | < | x | x | > | . | 0 | . | ^ |
-----------------------------------------
| . | . | . | 3 | . | 2 | . | . | 2 | v |
-----------------------------------------

The space between the two 3s and the 4 must have a ship part, otherwise it becomes impossible to place enough parts in that area.

-----------------------------------------
| 2 | . | 1 | . | 1 | . | 3 | . | . |   |
-----------------------------------------
| < | > | . | 0 | . | < | x | > | 2 | 1 |
-----------------------------------------
| 2 | . | . | . | 1 | . | . | . | . | o |
-----------------------------------------
| . | . | 1 | . | . | 0 | . | ^ | 3 | . |
-----------------------------------------
|   | . | . | ? | . | . | . | ? | . | 0 |
-----------------------------------------
|   |   | 3 |   | 3 |   |   |   | . | . |
-----------------------------------------
|   |   | . | ? | 2 | . | . | 1 |   |   |
-----------------------------------------
| . | . | . | 4 | . | . | 1 | . | . | 2 |
-----------------------------------------
| 0 | . | < | x | x | > | . | 0 | . | ^ |
-----------------------------------------
| . | . | . | 3 | . | 2 | . | . | 2 | v |
-----------------------------------------

If the space between the 3s is empty, we find that it is not possible to place all the remaining ships (either we need 5 caravels, or there is nowhere for the other frigate). So the frigate is between the 3s.

-----------------------------------------
| 2 | . | 1 | . | 1 | . | 3 | . | . |   |
-----------------------------------------
| < | > | . | 0 | . | < | x | > | 2 | 1 |
-----------------------------------------
| 2 | . | . | . | 1 | . | . | . | . | o |
-----------------------------------------
| . | . | 1 | . | . | 0 | . | ^ | 3 | . |
-----------------------------------------
|   | . | . | ^ | . | . | . | v | . | 0 |
-----------------------------------------
|   | . | 3 | x | 3 | . | . | . | . | . |
-----------------------------------------
|   | . | . | v | 2 | . | . | 1 |   |   |
-----------------------------------------
| . | . | . | 4 | . | . | 1 | . | . | 2 |
-----------------------------------------
| 0 | . | < | x | x | > | . | 0 | . | ^ |
-----------------------------------------
| . | . | . | 3 | . | 2 | . | . | 2 | v |
-----------------------------------------

And all that's left is to place the remaining 3 caravels:

-----------------------------------------
| 2 |   | 1 |   | 1 |   | 3 |   |   |   |
-----------------------------------------
| < | > |   | 0 |   | < | x | > | 2 | 1 |
-----------------------------------------
| 2 |   |   |   | 1 |   |   |   |   | o |
-----------------------------------------
|   |   | 1 |   |   | 0 |   | ^ | 3 |   |
-----------------------------------------
| o |   |   | ^ |   |   |   | v |   | 0 |
-----------------------------------------
|   |   | 3 | x | 3 |   |   |   |   |   |
-----------------------------------------
| o |   |   | v | 2 |   |   | 1 | o |   |
-----------------------------------------
|   |   |   | 4 |   |   | 1 |   |   | 2 |
-----------------------------------------
| 0 |   | < | x | x | > |   | 0 |   | ^ |
-----------------------------------------
|   |   |   | 3 |   | 2 |   |   | 2 | v |
-----------------------------------------
• dang that was fast, although I admit this one was easy. I still need time to make a puzzle to combine the 2 variations together to solve, but I'll give you the tick once you finish the wip. – Yaze Nov 6 '15 at 0:14
• it reminds me of minesweeper lol – Mekalikot Nov 6 '15 at 1:11
• @Mekalikot it is more or less minesweeper with battleship twist.Look up battleship minesweeper if you are interested in this type of puzzles. This will be the only one of this genre I'll be posting however, because I think that creating a puzzle where you need both variation to solve would be much more interesting. – Yaze Nov 6 '15 at 1:49