-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
22 lines (17 loc) · 706 Bytes
/
testing.py
File metadata and controls
22 lines (17 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import lib_sudoku as sudoku
import time
def tests():
reader = sudoku.PuzzleReader(
"https://raw.githubusercontent.com/shaggysa/lib_sudoku/master/puzzles.csv", True
)
sudoku.async_speedtest(reader)
sudoku.synchronous_speedtest(reader)
#sudoku.print_puzz(sudoku.solve([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1]))
num_hints = 24
start_gen = time.time()
sudoku.gen_unsolved(num_hints)
print(
f"Generated a puzzle with {num_hints} hints in {(time.time() - start_gen)*1000} milliseconds."
)
if __name__ == "__main__":
tests()