Very cool, but still some room for improvement. You can see at the very bottom that the algorithm doesn't know how many battleships there are in the game. Specifically, even though every other ship has been sunk, and it knows the battleship runs up/down, it still has non-zero probability for ships going off to the left. It should be able to rule those gray tiles out completely by that point.<p>Also this leaves open the question of how best to place ships to avoid being hit? :)