aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-17 16:26:35 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-17 16:26:35 +0100
commit89dc00913c770e76af9eee5b68242414dbf0feac (patch)
tree19daaa96176dd32dbad2bea00a8dc4a047fc569a
parent43c9672808e9ff6c1016f60075cfb932032e16be (diff)
downloadadventofcode2016-89dc00913c770e76af9eee5b68242414dbf0feac.tar.gz
adventofcode2016-89dc00913c770e76af9eee5b68242414dbf0feac.tar.xz
adventofcode2016-89dc00913c770e76af9eee5b68242414dbf0feac.zip
day17
-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