Battleship

Solving Battleships with SAT

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

cnf.comment('declare ships')
cnf.auto_mode = 'wo'
for prefix, x1, y1, size, d in all_ships:
    f(prefix, x1, y1, size, d)
cnf.comment('declare board')
for x,y in product(xs, ys):
    f(x,y)
cnf.auto_mode = 'ro'
Name:
Mail: (not shown)

Please type this: