Skip to content

Commit 17a8596

Browse files
author
Hamid Gasmi
committed
Issue #141 is completed
1 parent c51b4b7 commit 17a8596

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

4-np-complete-problems/1-np_complete_problems/sudokusolver.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def exactly_one_of(literals):
4949
k = int(puzzle[i - 1][j - 1])
5050
assert(k in digits)
5151
#[i,j] already contains k:
52-
clauses.append(varnum(i, j, k))
52+
clauses.append([varnum(i, j, k)])
5353

54-
with open('temp.cnf', 'w') as f:
54+
with open('tmp.cnf', 'w') as f:
5555
f.write("p cnf {} {}\n".format(999, len(clauses)))
5656
for c in clauses:
5757
c.append(0)
@@ -78,3 +78,6 @@ def exactly_one_of(literals):
7878
break
7979

8080
print("")
81+
82+
os.remove("tmp.sat")
83+
os.remove("tmp.cnf")

0 commit comments

Comments
 (0)