Files
advent_of_code/2016/2/main.ua

17 lines
423 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# aoc 2016/2
&fras "input.txt"
⍜⇌(▽⊸(>0\+≠@\n)) # world's most complicated right-trim
# parse each letter of the puzzle input.
# update position vector.
⊂∧(
⍣(⍩(-i) ◌°.@U
| ⍩(+i) ◌°.@D
| ⍩(-1) ◌°.@L
| ⍩(+1) ◌°.@R
| ⍩(⟜⊂) ◌°.@\n)
⍜°ℂ∩(↥¯1↧1) # clamp vector
)⊙0⊙[]
⍉⊟°ℂ +1 1 # translate
⌝⊥10 ⊡⊙(+1°△3_3) # grab code
$Part₁