-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (21 loc) · 818 Bytes
/
main.py
File metadata and controls
24 lines (21 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from sudoku_grid import SudokuGrid
import utils_sudoku as us
def get_grid_infos():
valid_input = False
while not valid_input:
columns = input("Enter the number of columns in the Sudoku grid: ")
lines = input("And the number of rows it contains: ")
s_columns = input("Enter the number of columns in sub-grids: ")
s_lines = input("And the number of rows they contain: ")
if us.valid_grid_format(columns, lines, s_columns, s_lines):
valid_input = True
else:
print("Invalid input. Try again !\n")
return SudokuGrid(int(columns), int(lines), int(s_columns), int(s_lines))
def main():
my_sudoku = get_grid_infos()
my_sudoku.fill_grid()
new = my_sudoku.algorithm()
new.display_grid()
if __name__ == "__main__":
main()