mirror of
https://github.com/fredrikr79/advent_of_code.git
synced 2026-08-04 15:53:04 +02:00
solve 2016/2 part 1 in uiua
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
# 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₁
|
||||||
Reference in New Issue
Block a user