This is a 3D version of “Shoal Patrol.” The grid is a combination of Battleship, Minesweeper, and loop puzzle. The completed grid is as follows; see below for the solving path. The minesweeper values of the 1-cell ships (the four ‘?’ in the given data) are, in order along the loop, 13, 1, 19, and 20. Indexing into the alphabet gives the answer: MAST
.
Battleship: Solving starts with the battleships; unlike “Shoal Patrol,” here the battleship puzzle can be solved completely without using minesweeper and loop constraints.
The usual battleship strategies apply: no two ship segments can touch diagonally, so placing a ship segment allows one to exclude ship segments on the diagonally adjacent cells (up to 20 of them: 4 in the same layer, 8 in the layers above and below). Conversely, if a row is nearly full then some cells in the adjacent rows (including in the adjacent layers) cannot contain ship segments.
The rows/columns containing the largest number of ship segments, and those immediately next to them, are typically the most constrained and those that hold the key to the battleships puzzle.
Here, the fourth and sixth layers (from top) are most constrained. One can place a 2-ship, a 3-ship and an isolated segment (which is in fact part of a vertical ship) in layer 4, and complete layer 6. This in turn excludes a number of cells in layers 3, 5, and 7.
The following successive observations essentially unlock the upper layers of the grid:
This allows one to complete layers 2 and 3, and make further progress on layers 1 and 4. The bottom layer can also be partially solved on its own.
At this point, we look for the 3- and 4-ships. (To help the search for potential vertical ships, note that there are no vertical ships through layer 6, so every vertical 3-ship must pass through layer 3, and every vertical 4-ship must pass through layers 2-3-4).
We conclude that there is a 4-ship in row 2 of layer 1, and 3-ships in row 6 of layer 1 and vertically in row 6 column 7, while the two ambiguous options (row 3 of layer 7, and vertically in row 4 column 7) contain one 3-ship and one 4-ship.
It is then easy to complete the battleship puzzle.
Ship identification: the next stage is to identify which ships can contain which minesweeper clues. The key observation is that high value minesweeper clues cannot occur on grid edges, and can constrain the loop as well. Namely, the minesweeper clue on a ship segment in the interior of the cube is at most 24 (since two of the 26 neighboring cells must also lie on the loop and cannot contain mines); on the interior of a face of the cube, it is at most 15; on an edge of the cube, it is at most 9; on a vertex of the cube, it is at most 5. Moreover, when these maximum values are attained, all cells diagonally adjacent to the ship segment must contain mines, and hence the loop must go straight immediately before and immediately after the considered cell (but can turn on the cell itself).
We start with the 4-ships:
A useful way to study the local behavior of the loop and mines near a given ship (especially 3-and 4-ships) is to consider the successive planes of cells that touch the ship, slicing perpendicularly to the direction of the ship, to find the number of mines and the number of cells used by the loop in each plane.
For the 5-5-6-6 ship, each plane consists of 4 cells, in columns 1 and 2 of layers 1 and 2. Working from the corner, we find successively: in row 7, 2 mines and only one loop cell (hence the loop must go straight through it); in row 6, 3 mines (these all follow from the 5 clue at the corner of the cube; next we use the subsequent minesweeper clues); then in row 5, 3 empty cells (no loop, no mines); in row 4, 3 mines; in row 3, 3 mines and necessarily one loop cell (hence the loop must keep going straight through it, into row 2).
For the 15-9-9-10 ships in the top and bottom layers, each plane consists of 6 cells, in rows 1-3 of layers 1-2 or rows 2-4 of layers 6-7. Starting from the side with the 15 clue (unknown so far), we find that the successive planes contain 6, 4, 5, 0, 4, 6 mines; and necessarily the loop turns at both extremities of the ship and goes straight through the adjacent cells. Thus, most of the mines can be placed around these ships and the solution can proceed even without knowing which end is 15 and which end is 10; the only difference between the two orientations is which of the two planes through the middle of the ship remains empty and which one is filled with mines.
We leave the 3-3-6-10 ship as an exercise.
Next we look at the 3-ships:
These deductions concerning the 3- and 4-ships allow one to start placing a number of mines and significant portions of the loop; paying close attention to the no-touching constraint on the loop (which also prevents the loop from ever touching a ship that it does not immediately connect to) is key.
At that point, identifying the minesweeper values of the 2-ships (and orienting the 15-9-9-10 and 10-10-15 ships), placing mines, and completing the loop, is mostly a matter of careful accounting. Some cells remain undetermined, but the total number of forced mines is already 178, so those remain empty. One can then count the minesweeper values of the 1-ships to extract the answer.