reformat
This commit is contained in:
parent
f5544299da
commit
798e8c3faa
@ -298,7 +298,8 @@ class Grid:
|
|||||||
while queue:
|
while queue:
|
||||||
current = queue.popleft()
|
current = queue.popleft()
|
||||||
found_end = False
|
found_end = False
|
||||||
for c in self.getNeighboursOf(current, includeDiagonal=includeDiagonal, includeDefault=self.__default not in walls):
|
for c in self.getNeighboursOf(current, includeDiagonal=includeDiagonal,
|
||||||
|
includeDefault=self.__default not in walls):
|
||||||
if c in came_from and self.get(c) in walls:
|
if c in came_from and self.get(c) in walls:
|
||||||
continue
|
continue
|
||||||
came_from[c] = current
|
came_from[c] = current
|
||||||
@ -411,7 +412,9 @@ class Grid:
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
def get_aoc_ocr_string(self, x_shift: int = 0, y_shift: int = 0):
|
def get_aoc_ocr_string(self, x_shift: int = 0, y_shift: int = 0):
|
||||||
return convert_array_6([['#' if self.get(Coordinate(x + x_shift, y + y_shift)) else '.' for x in self.rangeX()] for y in self.rangeY()])
|
return convert_array_6(
|
||||||
|
[['#' if self.get(Coordinate(x + x_shift, y + y_shift)) else '.' for x in self.rangeX()] for y in
|
||||||
|
self.rangeY()])
|
||||||
|
|
||||||
def __str__(self, true_char: str = '#', false_char: str = "."):
|
def __str__(self, true_char: str = '#', false_char: str = "."):
|
||||||
return "/".join(
|
return "/".join(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user