From 61dee8feb971eeba670ed95dcc8e65d7a60248eb Mon Sep 17 00:00:00 2001 From: Burnus Date: Tue, 19 Dec 2023 18:37:37 +0100 Subject: [PATCH] Fixed challenge.txt for 2023 day 18 --- 2023/day18_lavaduct_lagoon/challenge.txt | 40 ++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/2023/day18_lavaduct_lagoon/challenge.txt b/2023/day18_lavaduct_lagoon/challenge.txt index f862200..45dda56 100644 --- a/2023/day18_lavaduct_lagoon/challenge.txt +++ b/2023/day18_lavaduct_lagoon/challenge.txt @@ -58,6 +58,42 @@ Now, the lagoon can contain a much more respectable `*62*` cubic meters of lava. The Elves are concerned the lagoon won't be large enough; if they follow their dig plan, *how many cubic meters of lava could it hold?* -To begin, [get your puzzle input](18/input). +Your puzzle answer was `34329`. -Answer: \ No newline at end of file +\--- Part Two --- +---------- + +The Elves were right to be concerned; the planned lagoon would be *much too small*. + +After a few minutes, someone realizes what happened; someone *swapped the color and instruction parameters* when producing the dig plan. They don't have time to fix the bug; one of them asks if you can *extract the correct instructions* from the hexadecimal codes. + +Each hexadecimal code is *six hexadecimal digits* long. The first five hexadecimal digits encode the *distance in meters* as a five-digit hexadecimal number. The last hexadecimal digit encodes the *direction to dig*: `0` means `R`, `1` means `D`, `2` means `L`, and `3` means `U`. + +So, in the above example, the hexadecimal codes can be converted into the true instructions: + +* `#70c710` = `R 461937` +* `#0dc571` = `D 56407` +* `#5713f0` = `R 356671` +* `#d2c081` = `D 863240` +* `#59c680` = `R 367720` +* `#411b91` = `D 266681` +* `#8ceee2` = `L 577262` +* `#caa173` = `U 829975` +* `#1b58a2` = `L 112010` +* `#caa171` = `D 829975` +* `#7807d2` = `L 491645` +* `#a77fa3` = `U 686074` +* `#015232` = `L 5411` +* `#7a21e3` = `U 500254` + +Digging out this loop and its interior produces a lagoon that can hold an impressive `*952408144115*` cubic meters of lava. + +Convert the hexadecimal color codes into the correct instructions; if the Elves follow this new dig plan, *how many cubic meters of lava could the lagoon hold?* + +Your puzzle answer was `42617947302920`. + +Both parts of this puzzle are complete! They provide two gold stars: \*\* + +At this point, you should [return to your Advent calendar](/2023) and try another puzzle. + +If you still want to see it, you can [get your puzzle input](18/input). \ No newline at end of file