From f59e1530a5467fb408954e029d9c7e8fdc7c4449 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sat, 9 Dec 2023 19:59:06 +0100 Subject: [PATCH] use regular set 0 for aesthetics --- Day8/Part1.js | 4 ++-- Day8/Part2.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Day8/Part1.js b/Day8/Part1.js index 0de2239..de19b03 100644 --- a/Day8/Part1.js +++ b/Day8/Part1.js @@ -12,8 +12,8 @@ const maps = input.slice(1).map((a) => { const [_, L, R] = mapping; return { name, mapping: { L, R } }; }); -let count, - index = (count = 0); +let count = 0, + index = 0; let current = maps.find((e) => e.name === "AAA"); while (current.name !== "ZZZ") { const direction = instructions[index]; diff --git a/Day8/Part2.js b/Day8/Part2.js index 0de2239..de19b03 100644 --- a/Day8/Part2.js +++ b/Day8/Part2.js @@ -12,8 +12,8 @@ const maps = input.slice(1).map((a) => { const [_, L, R] = mapping; return { name, mapping: { L, R } }; }); -let count, - index = (count = 0); +let count = 0, + index = 0; let current = maps.find((e) => e.name === "AAA"); while (current.name !== "ZZZ") { const direction = instructions[index];