From 5e26df54c823bd38068e3d69011e2f655e2d81a8 Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Fri, 13 Dec 2024 10:29:23 -0500 Subject: [PATCH] comments --- src/day12/index.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/day12/index.ts b/src/day12/index.ts index 964cee7..1055273 100644 --- a/src/day12/index.ts +++ b/src/day12/index.ts @@ -104,13 +104,24 @@ const part2 = (rawInput: string) => { const nextDirection = (thisDirection + 1) % 4 const presentNextDirection = orthogonalProbes[nextDirection] if ( - presentThisDirection && - presentNextDirection && - !diagonalProbes[thisDirection] + // example: plot is X, direction is right + // ### + // #XA + // #B. + presentThisDirection && // A + presentNextDirection && // B + !diagonalProbes[thisDirection] // . ) { corners += 1 } - if (!presentThisDirection && !presentNextDirection) { + if ( + // example: plot is X, direction is right + // ##. + // #X! + // .!. + !presentThisDirection && // ! + !presentNextDirection // ! + ) { corners += 1 } })