about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-15 20:49:50 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-15 20:49:50 +0100
commita3a3b2ad646db94df0c5b878bd9ee7b797db7650 (patch)
tree0589bea152862fe8149abb50047da798b6b46c14
parentf50c04e071ededa9ddbe74e072caffd8e3d0cbec (diff)
downloadadventofcode2016-a3a3b2ad646db94df0c5b878bd9ee7b797db7650.tar.gz
adventofcode2016-a3a3b2ad646db94df0c5b878bd9ee7b797db7650.tar.xz
adventofcode2016-a3a3b2ad646db94df0c5b878bd9ee7b797db7650.zip
day14: tweaks
-rw-r--r--day14.k3
1 files changed, 2 insertions, 1 deletions
diff --git a/day14.k b/day14.k
index d516afd..33f3168 100644
--- a/day14.k
+++ b/day14.k
@@ -1,3 +1,4 @@
+/ use q 2016.03.14
 d:"zpqevtbw"
 
 k:,/$-15!d,$:
@@ -10,7 +11,7 @@ r:()
 
 r:()
 h:(,-1)!,""
-s:{$[~""~h[x];h[x];:h[x]:2016(,/$-15!)/(,/$-15!d,$:x)]}
+s:{$[x in !h;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]