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

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