Cover everytime the map generation test

This commit is contained in:
Yohann D'ANELLO 2021-01-10 23:05:49 +01:00
parent 8f845d1e4c
commit b0ca1d4edf
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ class TestBroguelike(unittest.TestCase):
def is_connex(self, grid: List[List[Tile]]) -> bool:
h, w = len(grid), len(grid[0])
y, x = randint(0, h - 1), randint(0, w - 1)
while not (grid[y][x].can_walk() or grid[y][x] == Tile.DOOR):
y, x = -1, -1
while not grid[y][x].can_walk():
y, x = randint(0, h - 1), randint(0, w - 1)
queue = Map.neighbourhood(grid, y, x)
while queue: