Skip to content

Commit

Permalink
Day 13 solution.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed Dec 17, 2018
1 parent 1f3cb2e commit f1b21a2
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 0 deletions.
17 changes: 17 additions & 0 deletions p13.dyalog
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
⎕IO0
sort{()}
p⎕NGET'p13.txt'1
g'|'@('^v')'-'@('<>')p grid
m4>t'^>v<'p

xm
c0×d(,m)/,t
turn{='/':(d)4|1-d ='\':(d)3-d ='+':(d)4|(d)+¯1+3|c 0}
move{z(x)+(d)4 2¯1 0 0 1 1 0 0 ¯1 (z)x:r,z (x)z _ turn (azg) (c)+'+'=a}
tick{move¨x}
r {}tick{×r}0 2r part 1

xm
v1+c0×d(,m)/,t
move{z(x)+(d)4 2¯1 0 0 1 1 0 0 ¯1 i(x)z v[ i/1 1v[ i/i<v]]0 (x)z _ turn (azg) (c)+'+'=a}
{}tick{1=+/v}0 vx part 2
Loading

0 comments on commit f1b21a2

Please sign in to comment.