You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
puzzle = [list(line) for line in file.read().strip().splitlines()]
def run(ref):
changed = False
for x in range(len(ref)):
for y in range(len(ref[x])):
if ref[x][y] in ('#', 'L'):
neighbors = 0
for offset_x in range(-1, 2):
for offset_y in range(-1, 2):
if (offset_x or offset_y) and x + offset_x >= 0 and x + offset_x < len(ref) and y + offset_y >= 0 and y + offset_y < len(ref[x]) and ref[x + offset_x][y + offset_y] == '#':