MCPcopy Create free account
hub / github.com/geekcomputers/Python / solve

Function solve

sudoku.py:14–30  ·  view source on GitHub ↗
(bo)

Source from the content-addressed store, hash-verified

12
13
14def solve(bo):
15 find = find_empty(bo)
16 if not find:
17 return True
18 else:
19 row, col = find
20
21 for i in range(1, 10):
22 if valid(bo, i, (row, col)):
23 bo[row][col] = i
24
25 if solve(bo):
26 return True
27
28 bo[row][col] = 0
29
30 return False
31
32
33def valid(bo, num, pos):

Callers 1

sudoku.pyFile · 0.70

Calls 2

find_emptyFunction · 0.85
validFunction · 0.85

Tested by

no test coverage detected