Solving Battleships with SAT

Comments are moderated. It may take a few minutes before your comment appears.
Markdown is supported in your comments.

What follows is probably the most complicated section of code. No ships are allowed to overlap, or be too close to each other. Normally I would use combinations(all_ships, 2) to go through all the pairs of ships but nested for loops allows for easier re-use of the points1 and water1 sets.

Mail: (not shown)

Please type this: