We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c51b4b7 commit 17a8596Copy full SHA for 17a8596
4-np-complete-problems/1-np_complete_problems/sudokusolver.py
@@ -49,9 +49,9 @@ def exactly_one_of(literals):
49
k = int(puzzle[i - 1][j - 1])
50
assert(k in digits)
51
#[i,j] already contains k:
52
- clauses.append(varnum(i, j, k))
+ clauses.append([varnum(i, j, k)])
53
54
-with open('temp.cnf', 'w') as f:
+with open('tmp.cnf', 'w') as f:
55
f.write("p cnf {} {}\n".format(999, len(clauses)))
56
for c in clauses:
57
c.append(0)
@@ -78,3 +78,6 @@ def exactly_one_of(literals):
78
break
79
80
print("")
81
+
82
+os.remove("tmp.sat")
83
+os.remove("tmp.cnf")
0 commit comments