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('apply simple givens')
for x,y in in_bounds:
    if table[(x,y)] == '.':
        continue
    if table[(x,y)] == '~':
        cnf.write_one(-f(x,y))
        continue
    # other symbols
    cnf.write_one(f(x,y))
Name:
Mail: (not shown)

Please type this: