forked from thomas.barbier/connect4
Merge branch 'main' of https://codefirst.iut.uca.fr/git/thomas.barbier/connect4
commit
f5ad334b72
@ -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