2019-11-30 13:55:22 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
"""This is a Sudoku Solver."""
|
|
|
|
|
|
|
|
from board import Board
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
string = (
|
|
|
|
"..4...618\n"
|
|
|
|
"9...8....\n"
|
|
|
|
".2...6.4.\n"
|
|
|
|
"...5.34.6\n"
|
|
|
|
"7.3.1.2.5\n"
|
|
|
|
"6.94.7...\n"
|
|
|
|
".6.2...8.\n"
|
|
|
|
"....4...3\n"
|
|
|
|
"418...7..\n"
|
|
|
|
)
|
|
|
|
|
|
|
|
board = Board(string)
|
|
|
|
|
|
|
|
print(board)
|
|
|
|
|
|
|
|
board.compute_possible_values()
|
|
|
|
board.intersect_possible_values()
|
|
|
|
board.create_squares()
|
|
|
|
|
2019-11-30 15:21:33 +01:00
|
|
|
print(board)
|
|
|
|
|
2019-11-30 13:55:22 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|