Skip to content

Commit c6146cf

Browse files
committed
Update Sudoku-Solver.py
1 parent 72ddc31 commit c6146cf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Sudoku-Solver.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,18 @@ def Sudoku(grid,row,col):
3131
return True
3232
grid[row][col]=0
3333
return False
34+
3435
# Give zero for empty cells, put each row in list, put all rows in nested list
35-
grid=[[0,0,1,0,6,0,0,0,0],[0,0,0,0,0,0,2,3,8],[0,7,0,2,0,0,0,4,0],[7,0,0,0,0,6,0,0,0],[0,9,3,1,4,0,5,0,0],[0,8,0,0,5,0,0,0,4],[0,3,0,0,7,0,8,0,0],[0,6,5,4,1,0,0,0,2],[2,0,0,0,0,3,0,0,0]]
36+
grid=[[0,0,1,0,6,0,0,0,0],
37+
[0,0,0,0,0,0,2,3,8],
38+
[0,7,0,2,0,0,0,4,0],
39+
[7,0,0,0,0,6,0,0,0],
40+
[0,9,3,1,4,0,5,0,0],
41+
[0,8,0,0,5,0,0,0,4],
42+
[0,3,0,0,7,0,8,0,0],
43+
[0,6,5,4,1,0,0,0,2],
44+
[2,0,0,0,0,3,0,0,0]]
45+
3646
if Sudoku(grid,0,0):
3747
puzzle(grid)
3848
else:

0 commit comments

Comments
 (0)