about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-14 15:45:08 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-14 15:45:08 +0100
commitec84729ebd3b1e7b482b6679fc4b05cfaebd99af (patch)
tree1c3298991f553703cd63f4753bde9489bd460fba
parent0309be83336daed08bd09d06d4d079edd13f1fdf (diff)
downloadadventofcode2016-ec84729ebd3b1e7b482b6679fc4b05cfaebd99af.tar.gz
adventofcode2016-ec84729ebd3b1e7b482b6679fc4b05cfaebd99af.tar.xz
adventofcode2016-ec84729ebd3b1e7b482b6679fc4b05cfaebd99af.zip
day14
-rw-r--r--day14.k19
1 files changed, 19 insertions, 0 deletions
diff --git a/day14.k b/day14.k
new file mode 100644
index 0000000..d516afd
--- /dev/null
+++ b/day14.k
@@ -0,0 +1,19 @@
+d:"zpqevtbw"
+
+k:,/$-15!d,$:
+r:()
+{64>#r}{ t::{~|/(1=#?:)'{1_x,y}\[3#0;k x]}(1+)/x
+  p:: 5#k[t]@*&(1=#?:)'{1_x,y}\[3#0;k t]
+  $[#&{#ss[x;p]}'k't+1+!1000; r,:t;]
+  t+1 }/0;
+*|r	/ 16106
+
+r:()
+h:(,-1)!,""
+s:{$[~""~h[x];h[x];:h[x]:2016(,/$-15!)/(,/$-15!d,$:x)]}
+{64>#r}{ t::{~|/(1=#?:)'{1_x,y}\[3#0;s x]}(1+)/x
+  -1@($t)," ",($#r)
+  p:: 5#s[t]@*&(1=#?:)'{1_x,y}\[3#0;s t]
+  $[#&{#ss[x;p]}'s't+1+!1000; r,:t;]
+  t+1 }/0;
+*|r	/ 22423