diff options
author | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-02-09 16:50:16 +0200 |
---|---|---|
committer | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-02-09 16:50:16 +0200 |
commit | 69da1795b78841a8ffb44c5da5fc0011c6d02de9 (patch) | |
tree | 525c69c953f42a07034f4e6129f504395d268c61 /board | |
parent | 027f4c0b27b2bfe5541c16b9d7a355c49db891f7 (diff) |
Refactoring tests some more.v0.1-gamma
Diffstat (limited to 'board')
-rw-r--r-- | board/board.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/board/board.py b/board/board.py index 118a771..36ceb62 100644 --- a/board/board.py +++ b/board/board.py @@ -18,14 +18,19 @@ class Board(): board = None): # pylint: disable = too-many-arguments + if ( not width or not height or + width not in range(2,51) or + height not in range(2,51) ): + width, height = None, None + self.__level = level self.__width, self.__height, self.__mines =LevelSpecs[self.__level][:3] - if width and width in range(2,51): + if width: self.__width = width - if height and height in range(2,51): + if height: self.__height = height - if mines: + if height or width or mines: self.__mines = mines if self.__mines not in range(1,self.__width*self.__height): |