diff --git a/day17.py b/day17.py index 31937d7..c568db8 100644 --- a/day17.py +++ b/day17.py @@ -22,7 +22,7 @@ def simulate(active_cubes, fourD=False): if not (x == cx and y == cy and z == cz): active_neighbours[(cx, cy, cz)] += 1 else: - for cw in [active_cube[3] - 1, active_cube[3], active_cube[3] + 1]: + for cw in [w - 1, w, w + 1]: if not (x == cx and y == cy and z == cz and w == cw): active_neighbours[(cx, cy, cz, cw)] += 1