From d162555dfaceef8abf3a6c46970c0fd078a4aab9 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Thu, 17 Dec 2020 08:47:54 +0100 Subject: [PATCH] day17: missed one var substitution --- day17.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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