I've been playing with the Midnight Mysteries series lately and I've come across a nice battleship-like minigame with an associated achievement: find all ship parts without missing a hit (called "Dead Eye").
I have created a brute-force algorithm to solve this randomly generated puzzle. The algorithm sequentially modifies coordinates until the given layout matches the given coverage numbers.
Two considerations:
1) The algorithm may find multiple, same looking solutions when two or three of the same kind appears in a row or column;
2) sometimes, multiple distinct solutions may exist without any safe shots. In the example below, two horizontal 2 length ships can be present at either (0, 4)+(2, 3) or (0, 3)+(2, 4). A safe shot would be to put one at (0, 4) and then see the graphics indicate if this is the beginning or end of the ship.
Code @ GitHub