Changing the way the tile matrix is declared so that every column is represented by a different list

This commit is contained in:
Charles Peyrat 2020-12-11 01:04:30 +01:00
parent 7cfe55f42c
commit d40a61554e
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ class Generator:
def run(self):
width, height = self.params["width"], self.params["height"]
walkers = [Walker(width//2, height//2)]
grid = [[Tile.WALL] * width] * height
grid = [[Tile.WALL for _ in range(width)] for _ in range(height)]
count = 0
while count < self.params["fill"] * width*height:
# because we can't add or remove walkers while looping over the pop