Compare commits
2 Commits
69e28e79b3
...
d1218547cb
Author | SHA1 | Date |
---|---|---|
![]() |
d1218547cb | 2 years ago |
![]() |
147e5268bc | 2 years ago |
@ -1,8 +1,23 @@
|
||||
class Rules:
|
||||
def __init__(self):
|
||||
name = None
|
||||
nb_row = None
|
||||
nb_col = None
|
||||
self.name = None
|
||||
self.nb_row = None
|
||||
self.nb_col = None
|
||||
|
||||
def check_board_size(self, board: Board) -> Bool:
|
||||
""" Checks if the board size is correct.
|
||||
Entries:
|
||||
self: the Rules class itself
|
||||
board -> Board: a board
|
||||
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
|
||||
|
||||
return correct
|
||||
|
Loading…
Reference in new issue