day17: missed one var substitution

This commit is contained in:
Stefan Harmuth 2020-12-17 08:47:54 +01:00
parent faaa50240d
commit d162555dfa

View File

@ -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