diff --git a/day14.ua b/day14.ua index 2b9caa8..1c906fe 100644 --- a/day14.ua +++ b/day14.ua @@ -26,7 +26,27 @@ PartIOriginal ← ( SlideLeft ← ≡(⍜⊜□(≡(□⊐/⊂⊕□∩°□)=@..)≠@#.) PartI ← /+♭×⊃(¤-⇡.⧻⊢|=@O)SlideLeft⍉ +Cycle ← ( + ⍜⍉SlideLeft # Up + SlideLeft # Left + ⍜(⍉⇌)SlideLeft # Down + ⍜≡⇌SlideLeft # Right +) + +# this code is fucking awful +PartII ← ( + ¤Cycle + ⍢(⊂Cycle⊢.)(¬∊⊃(⊢|↘1)) + ≡≍⊃↙↘1. + ⊙(+1)∩(⊗1)⇌. + ⍜(-|◿:)⊙1000000000 + ? + ⊡-1⊙⇌ + /+♭×⊃(-⇡.⧻⊢|=@O) +) PartI Parse TestInput +PartII Parse TestInput PartI Parse &fras "day14.in" +PartII Parse &fras "day14.in"