about summary refs log tree commit diff
path: root/day17.k
diff options
context:
space:
mode:
Diffstat (limited to 'day17.k')
-rw-r--r--day17.k15
1 files changed, 15 insertions, 0 deletions
diff --git a/day17.k b/day17.k
new file mode 100644
index 0000000..535b495
--- /dev/null
+++ b/day17.k
@@ -0,0 +1,15 @@
+/ use q 2016.03.14
+
+d:"veumntbg"
+
+b:1000#" "
+w:{$[(#x)<#b;$[3 3~t:+/(-1 0;1 0;0 -1;0 1;0 0)"UDLR"?x; b::x; &/t>-1; w'x,/:"UDLR"@&"a"<,/$2#-15!x; ];]}
+
+w d;
+(#d)_b	/ DDRRULRDRD
+
+l:0
+u:{$[&/4 4>|/t:+\(-1 0;1 0;0 -1;0 1;0 0)@"UDLR"?x; $[3 3~s:*|t; l::l|#x; $[&/s>-1; u'x,/:"UDLR"@&"a"<,/$2#-15!x;]];]}
+
+u d;
+l-#d	/ 536