# Help locate enemy fleet

Few days ago, the notorious Blackbeard sunk 3 of my ships carrying exotic goods and treasures from Asia. I was furious and I am determined to send out my fleet to bring him to justice. However, as he is a well known and a formidable pirate, I need to plan my attack carefully. So I send out a number of scouts, hoping they would be able to locate where they are.

To my delight, my scouts are successful in their first attempt to locate the pirates, and I have received the following message:

There are 10 ships in total, namely 1 flagship, 2 frigates, 3 corvettes, and 4 patrol boats located in the Caribbean sea. It seems like that they are anchored here and won't be moving any time soon. Furthermore, none of Blackbeard's ships touch each other, not even diagonally.

However, my military adviser says we need more information on their fleet formation so he can devise a plan to strike him down from where he is the weakest. So I replied to the scout to bring back that information.

That's exactly what they did, but this time, the information is not complete. The message is as follows

Please see the attached map for the pirate's fleet formation. The numbers are the number of ship pieces on that row or column

The map attached look like this

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&&&&&&&&&&1\\ \hline&&\blacktriangle&&&&&&&&1\\ \hline&&&&&&&&&&3\\ \hline&&&&&&&&&&1\\ \hline&\blacklozenge&&&&&&&&&4\\ \hline&&&&&&&&&&0\\ \hline&&&&&&&&&&0\\ \hline&&&&&\blacktriangleright&&&&&8\\ \hline&&&&&&&&&&1\\ \hline&&&&&&&&&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array} \quad\quad \bbox[4pt,border: 1px solid black]{ \begin{array}{llc} \bf{Legend:}&\\ \hline \text{Flagship:}& \blacktriangleleft\blacksquare\blacksquare\blacktriangleright \text{or} &\blacktriangle\\ &&\blacksquare\\ &&\blacksquare\\ &&\blacktriangledown\\ \hline \text{Frigate:}& \blacktriangleleft\blacksquare\blacktriangleright \text{or} &\blacktriangle\\ &&\blacksquare\\ &&\blacktriangledown\\ \hline \text{Corvette:}& \blacktriangleleft\blacktriangleright \text{or} &\blacktriangle\\ &&\blacktriangledown\\ \hline \text{Patrol Boat:}& \blacklozenge\\ \end{array}}$$

Clearly, something happened to the scout, and he wasn't able to finish the map. However, after seeing the map, my military adviser smirked and locked himself in the operation room to discuss the tactic with my admiral.

Did he really manage to locate the enemy ships based on that map? Can you deduce all the ships' locations via this map?

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&&&&&&&&\blacklozenge&&1\\ \hline&&\blacktriangle&&&&&&&&1\\ \hline&&\blacktriangledown&&&&\blacktriangle&&\blacklozenge&&3\\ \hline&&&&&&\blacksquare&&&&1\\ \hline&\blacklozenge&&&&&\blacktriangledown&&\blacktriangleleft&\blacktriangleright&4\\ \hline&&&&&&&&&&0\\ \hline&&&&&&&&&&0\\ \hline\blacktriangle&&\blacktriangleleft&\blacksquare&\blacksquare&\blacktriangleright&&\blacktriangleleft&\blacksquare&\blacktriangleright&8\\ \hline\blacktriangledown&&&&&&&&&&1\\ \hline&&&&&&&&\blacklozenge&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

• Yay! Good job, you solved it. – Yaze Nov 3 '15 at 0:38
• I don't have the time to describe in detail how I got the answer, so anyone who has to time to do it is welcome to edit. – Illyasviel Nov 3 '15 at 0:55
• I've posted a harder one if you want give it a shot – Yaze Nov 3 '15 at 18:33

Illyasviel beat me to the answer, but I'll show one possible process by which that answer can be derived.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&&&&&&&&\blacklozenge&&1\\ \hline&&\blacktriangle&&&&&&&&1\\ \hline&&\blacktriangledown&&&&\blacktriangle&&\blacklozenge&&3\\ \hline&&&&&&\blacksquare&&&&1\\ \hline&\blacklozenge&&&&&\blacktriangledown&&\blacktriangleleft&\blacktriangleright&4\\ \hline&&&&&&&&&&0\\ \hline&&&&&&&&&&0\\ \hline\blacktriangle&&\blacktriangleleft&\blacksquare&\blacksquare&\blacktriangleright&&\blacktriangleleft&\blacksquare&\blacktriangleright&8\\ \hline\blacktriangledown&&&&&&&&&&1\\ \hline&&&&&&&&\blacklozenge&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Begin with:

$$\def\b{\color{blue}\blacksquare} \def\ltri{\color{red}\blacktriangleleft} \def\rtri{\color{red}\blacktriangleright} \def\utri{\color{red}\blacktriangle} \def\dtri{\color{red}\blacktriangledown} \def\rsq{\color{red}\blacksquare} \def\rdi{\color{red}\blacklozenge} \begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&&&&&&&&&&1\\ \hline&&\utri&&&&&&&&1\\ \hline&&&&&&&&&&3\\ \hline&&&&&&&&&&1\\ \hline&\rdi&&&&&&&&&4\\ \hline&&&&&&&&&&0\\ \hline&&&&&&&&&&0\\ \hline&&&&&\rtri&&&&&8\\ \hline&&&&&&&&&&1\\ \hline&&&&&&&&&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

I use ?'s to mark spaces that are known to contain a ship segment, but when I do not know the correct symbol. $\b$ marks spaces that are known not to contain a ship.

First, mark all the spaces known to not contain a ship. In this pass, we get this from the 0's, from the 1's that already have segments them, and all spaces adjacent to a ship.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&\b&\b&\b&\b&\b&&&&&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline&\b&?&\b&\b&\b&&&&&3\\ \hline\b&\b&\b&\b&\b&\b&&&&&1\\ \hline\b&\rdi&\b&&\b&\b&&&&&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline&\b&&&?&\rtri&\b&&&&8\\ \hline&\b&&\b&\b&\b&\b&&&&1\\ \hline&\b&&&\b&\b&&&&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Use the 8. We have eliminated two spaces from that 8's row, therefore all the remaining spaces must contain a ship.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&\b&\b&\b&\b&\b&&\b&&&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline&\b&\dtri&\b&\b&\b&&\b&&&3\\ \hline\b&\b&\b&\b&\b&\b&&\b&&&1\\ \hline\b&\rdi&\b&\b&\b&\b&&\b&&&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline?&\b&\ltri&\rsq&\rsq&\rtri&\b&\ltri&\rsq&\rtri&8\\ \hline&\b&\b&\b&\b&\b&\b&\b&\b&\b&1\\ \hline&\b&\b&\b&\b&\b&&\b&&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Since there is a 1 directly below that 8, and horizontal ships cannot have a ship next to them, even diagonally, the far left [?] must be a ^.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline&\b&\b&\b&\b&\b&&\b&&&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline&\b&\dtri&\b&\b&\b&&\b&&&3\\ \hline\b&\b&\b&\b&\b&\b&&\b&&&1\\ \hline\b&\rdi&\b&\b&\b&\b&&\b&&&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\utri&\b&\ltri&\rsq&\rsq&\rtri&\b&\ltri&\rsq&\rtri&8\\ \hline?&\b&\b&\b&\b&\b&\b&\b&\b&\b&1\\ \hline&\b&\b&\b&\b&\b&&\b&&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Since the ? fills that column's 2, we can close it as a $\dtri$ and block out the rest of that row.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline\b&\b&\b&\b&\b&\b&&\b&&&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\dtri&\b&\b&\b&&\b&&&3\\ \hline\b&\b&\b&\b&\b&\b&&\b&&&1\\ \hline\b&\rdi&\b&\b&\b&\b&&\b&&&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\utri&\b&\ltri&\rsq&\rsq&\rtri&\b&\ltri&\rsq&\rtri&8\\ \hline\dtri&\b&\b&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\b&\b&\b&\b&&\b&&&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Now, the 4 row can be filled in, since six spaces have been blocked out.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline\b&\b&\b&\b&\b&\b&&\b&&\b&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\dtri&\b&\b&\b&&\b&&\b&3\\ \hline\b&\b&\b&\b&\b&\b&&\b&\b&\b&1\\ \hline\b&\rdi&\b&\b&\b&\b&?&\b&\ltri&\rtri&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\utri&\b&\ltri&\rsq&\rsq&\rtri&\b&\ltri&\rsq&\rtri&8\\ \hline\dtri&\b&\b&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\b&\b&\b&\b&&\b&&\b&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Now we can fill in the rows above that 4, by the same elimination.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline\b&\b&\b&\b&\b&\b&\b&\b&&\b&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\dtri&\b&\b&\b&?&\b&?&\b&3\\ \hline\b&\b&\b&\b&\b&\b&?&\b&\b&\b&1\\ \hline\b&\rdi&\b&\b&\b&\b&\dtri&\b&\ltri&\rtri&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\utri&\b&\ltri&\rsq&\rsq&\rtri&\b&\ltri&\rsq&\rtri&8\\ \hline\dtri&\b&\b&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&&\b&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

Finally, we can place the last two patrol boats, in the only empty spaces remaining.

$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|l} \hline\b&\b&\b&\b&\b&\b&\b&\b&\rdi&\b&1\\ \hline\b&\b&\utri&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\dtri&\b&\b&\b&\utri&\b&\rdi&\b&3\\ \hline\b&\b&\b&\b&\b&\b&\rsq&\b&\b&\b&1\\ \hline\b&\rdi&\b&\b&\b&\b&\dtri&\b&\ltri&\rtri&4\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\b&\b&0\\ \hline\utri&\b&\ltri&\rsq&\rsq&\rtri&\b&\ltri&\rsq&\rtri&8\\ \hline\dtri&\b&\b&\b&\b&\b&\b&\b&\b&\b&1\\ \hline\b&\b&\b&\b&\b&\b&\b&\b&\rdi&\b&1\\ \hline2&1&3&1&1&1&3&1&5&2 \end{array}$$

• Good job, this one is simple as it can be solved via direct inference only. It is meant to introduce the Battleship type of puzzles here since I don't see any. I posted a harder one if you want to give it a shot. – Yaze Nov 3 '15 at 18:26