From 9227bb3e2b41052c71896eb3e8bcbba669276477 Mon Sep 17 00:00:00 2001 From: aprzn Date: Tue, 5 Dec 2023 08:28:56 -0500 Subject: [PATCH] day 5 part 1 done, part 2 hard --- day05.ua | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 day05.ua diff --git a/day05.ua b/day05.ua new file mode 100644 index 0000000..4a92e47 --- /dev/null +++ b/day05.ua @@ -0,0 +1,69 @@ +$ seeds: 79 14 55 13 +$ +$ seed-to-soil map: +$ 50 98 2 +$ 52 50 48 +$ +$ soil-to-fertilizer map: +$ 0 15 37 +$ 37 52 2 +$ 39 0 15 +$ +$ fertilizer-to-water map: +$ 49 53 8 +$ 0 11 42 +$ 42 0 7 +$ 57 7 4 +$ +$ water-to-light map: +$ 88 18 7 +$ 18 25 70 +$ +$ light-to-temperature map: +$ 45 77 23 +$ 81 45 19 +$ 68 64 13 +$ +$ temperature-to-humidity map: +$ 0 69 1 +$ 1 0 69 +$ +$ humidity-to-location map: +$ 60 56 37 +$ 56 93 4 +TestInput ← + +PartI ← ( + ↘6⊔⊃⊢(↘1)⊜□≠@\n. + ⊓( + ⊜parse≠@ . + | ∧( + >@9⊢.⊔ + (⍜(⊔⊢⇌|(⊂|¤;)type.):⊜parse≠@ .|⊂⊙i;) + )⊙{} + ) + ∧( + +×⊙¬⊃⋅∘( + ⊓⊔¤ + ∩/+≡( + ⍘[⊙⊙∘] + ×⊃(≥⋅⊙⋅∘|<+⋅⊙⊙∘|:-:⊙⊙⋅∘) + ⊃∘×⊙+ + ) + ) + ): +) + +PartII ← ( + ↘6⊔⊃⊢(↘1)⊜□≠@\n. + ⊓( + ↯¯1_2⊜parse≠@ . + | ∧( + >@9⊢.⊔ + (⍜(⊔⊢⇌|(⊂|¤;)type.):⊜parse≠@ .|⊂⊙i;) + )⊙{} + ) +) + +/↧ PartI TestInput +PartII TestInput