remove Board.__len__()
This commit is contained in:
parent
ae3490f478
commit
9c00dd61a4
1 changed files with 1 additions and 4 deletions
|
@ -28,9 +28,6 @@ class Board:
|
||||||
else:
|
else:
|
||||||
return len(self.rows[0])
|
return len(self.rows[0])
|
||||||
|
|
||||||
def __len__(self) -> int:
|
|
||||||
return self.height * self.width
|
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
def __post_init__(self) -> None:
|
||||||
# check char set
|
# check char set
|
||||||
chars = {c for c in "".join(self.rows)}
|
chars = {c for c in "".join(self.rows)}
|
||||||
|
@ -44,7 +41,7 @@ class Board:
|
||||||
|
|
||||||
# check buttons
|
# check buttons
|
||||||
assert all(
|
assert all(
|
||||||
button in range(len(self))
|
button in range(self.height * self.width)
|
||||||
for button in self.buttons
|
for button in self.buttons
|
||||||
), "Invalid buttons!"
|
), "Invalid buttons!"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue