From 9233539ece3a4205e46ba4cad4a3e1fdb133674f Mon Sep 17 00:00:00 2001 From: kitsunecafe Date: Sat, 14 Dec 2024 15:47:45 -0600 Subject: [PATCH] rename part3 to part2 so that it actually makes sense --- nine/src/bruteforce.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nine/src/bruteforce.js b/nine/src/bruteforce.js index 5a59543..612caab 100644 --- a/nine/src/bruteforce.js +++ b/nine/src/bruteforce.js @@ -79,7 +79,9 @@ const checksum = iter => { .reduce(add) } -const expand3 = x => x.split('').map(toInt).map((x, i) => ([x, i % 2, i % 2 ? -1 : i / 2])) +const expand2 = x => x.split('') + .map(toInt) + .map((x, i) => ([x, i % 2, i % 2 ? -1 : i / 2])) const defrag2 = blocks => { const len = blocks.length - 1 @@ -120,5 +122,5 @@ const checksum2 = blocks => { } const part1 = pipe(expand, enfrag, checksum) -const part3 = pipe(expand3, defrag2, checksum2) +const part2 = pipe(expand2, defrag2, checksum2)