A checkerboard search can find every straight ship of length two or more on an orthogonal grid. It does not cover single-cell ships, so check the remaining fleet first.
Switch from searching to following a hit
Color the grid like a chessboard. Any horizontal or vertical ship occupying at least two consecutive cells crosses both colors, so searching one color can eventually hit it. This is a coverage argument, not a promise of the fewest shots. Once you hit a ship, try its untested orthogonal neighbors. Two aligned hits suggest an axis, but do not prove they belong to one ship if the rules allow ships to touch.
Try the steps
- Check ship lengths and whether touching or single-cell ships are permitted.
- Use a spaced search while no unresolved hit is available; skip cells already marked as misses.
- After a hit, follow the likely line in both directions as needed and wait for the game's sunk confirmation.
Should I avoid every cell beside a sunk ship?
Only when that version explicitly forbids ships from touching. Otherwise those cells can contain another ship. A missed shot also does not rule out an entire row: it eliminates placements crossing that cell, not every possible placement along the row.