[rules] added a try except

main
Charles Antoine NOURY 2 years ago
parent 737d7a8b36
commit d660da3b7f

@ -12,12 +12,12 @@ class Rules:
Output:
correct -> Bool: if True, the board size is correct
"""
correct = True
if not self.nb_col == board.nb_col:
correct = False
if not self.nb_row == board.nb_row:
correct = False
try:
if self.nb_col == board.nb_col and self.nb_row == board.nb_row :
correct = True
except Exception:
print("Exception: check_board_size: col and row parameters might are compared to another type")
return correct

Loading…
Cancel
Save