Unable to load image

Advent of Code 2022: Day 8

Post solutions here :marseysad: :marseyill:

25
Jump in the discussion.

No email address required.

I'm sure there are neat ways to iterate through rotations, but fuck it, brute force gang 4 lyf fixed lol

m←⊃⍎¨¨⎕FIO[49]'8' ⋄ L←↑⍴m
h←{(L/⍳L)⊂,⍵} ⋄ r←{(⊂⍵){({⌽⍉⍵}⍣⍵)⍺}¨⍳4} ⋄ d←{⍵{({⍉⌽⍵}⍣⍵)⍺}¨⍳4}
+/,⊃∨/d⊃¨(L/⍳4)⊂,⊃{1,(⌽1↓⌽⌈\⍵)<1↓⍵}¨¨h¨r m
⌈/,⊃×/d{{(¯1 ¯1)↓(1 1)↓⍵}⊃⍵}¨{{0⍳⍨(¯1↓1↓⍵)<1⌷⍵}¨¨{(⊂⍵){⌽⍵↑⍺}¨⍳L}¨⍵}¨h¨r m
Jump in the discussion.

No email address required.

What language is this?

Jump in the discussion.

No email address required.

APL

the old one

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.