-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
50 lines (38 loc) · 1.25 KB
/
index.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import numpy
import random
from Sudoku import Sudoku
sudo = Sudoku()
# sudo.grid = numpy.array([[2, 5, 6, 8, 3, 0, 9, 0, 1],
# [0, 1, 0, 0, 0, 4, 0, 0, 0],
# [4, 0, 7, 0, 0, 0, 2, 0, 8],
# [0, 0, 5, 2, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 9, 8, 1, 0, 0],
# [0, 4, 0, 0, 0, 3, 0, 0, 0],
# [0, 0, 0, 3, 6, 0, 0, 7, 2],
# [0, 7, 0, 0, 0, 0, 0, 0, 3],
# [9, 0, 3, 0, 0, 0, 6, 0, 4]])
# sudo.grid = numpy.array([
# [5, 0, 0, 0, 7, 0, 0, 0, 0],
# [6, 0, 0, 1, 0, 0, 0, 0, 0],
# [0, 9, 0, 0, 0, 0, 0, 6, 0],
# [8, 0, 0, 0, 6, 0, 0, 0, 3],
# [0, 0, 0, 8, 0, 0, 0, 0, 1],
# [7, 0, 0, 0, 2, 0, 0, 0, 0],
# [0, 0, 0, 0, 0, 0, 2, 8, 0],
# [0, 0, 0, 4, 0, 9, 0, 0, 5],
# [0, 0, 0, 0, 8, 0, 0, 0, 9]
# ])
# sudo.grid = numpy.zeros(shape=(9,9))
# print(sudo.grid)
import time
start_time = time.time()
# sudo.createSudokuResolved(0)
# sudo.checkGrid()
sudo.solver()
print(sudo.grid)
# print("--------------------------------")
# sudo.solver()
# print(sudo.grid)
end_time = time.time()
total_time = end_time - start_time
print("Time: ", total_time)