3 lines
414 B
APL
3 lines
414 B
APL
input ← {a b←' '(≠⊆⊢)⍵⋄a (⍎b)} ¨ ⊃⎕NGET '../.cache/2021/2' 1
|
||
⎕ ← ×/⊃{d h←⍵⋄(d+((2⊃⍺)×'d'≡⊃⊃⍺)-((2⊃⍺)×'u'≡⊃⊃⍺)) (h+((2⊃⍺)×'f'≡⊃⊃⍺))}/⌽(⊂(0 0)), input
|
||
⎕ ← ×/1↓⊃{a h d←⍵⋄(a+((2⊃⍺)×'d'≡⊃⊃⍺)-((2⊃⍺)×'u'≡⊃⊃⍺)) (h+((2⊃⍺)×'f'≡⊃⊃⍺)) (d+((a×2⊃⍺)×'f'≡⊃⊃⍺))}/⌽(⊂(0 0 0)), input
|