|
|
@ -26,7 +26,27 @@ PartIOriginal ← (
|
|
|
|
|
|
|
|
|
|
|
|
SlideLeft ← ≡(⍜⊜□(≡(□⊐/⊂⊕□∩°□)=@..)≠@#.)
|
|
|
|
SlideLeft ← ≡(⍜⊜□(≡(□⊐/⊂⊕□∩°□)=@..)≠@#.)
|
|
|
|
PartI ← /+♭×⊃(¤-⇡.⧻⊢|=@O)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
|
|
|
|
PartI Parse TestInput
|
|
|
|
|
|
|
|
PartII Parse TestInput
|
|
|
|
|
|
|
|
|
|
|
|
PartI Parse &fras "day14.in"
|
|
|
|
PartI Parse &fras "day14.in"
|
|
|
|
|
|
|
|
PartII Parse &fras "day14.in"
|
|
|
|