day 14 part 2 done

main
aprzn 1 year ago
parent 8d32433194
commit 71f7171443

@ -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"

Loading…
Cancel
Save