about summary refs log tree commit diff
path: root/day14.k
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-12-15 13:52:16 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-12-15 13:52:16 +0100
commitf4e01b6401a224fddc3143b15031c6ef60e15efd (patch)
treed56265ce9dc32792cc20e613a408c4ab4892c6f0 /day14.k
parent84e0e9d9e382344e36103c36cb9b47137a75e7d3 (diff)
downloadadventofcode2017-f4e01b6401a224fddc3143b15031c6ef60e15efd.tar.gz
adventofcode2017-f4e01b6401a224fddc3143b15031c6ef60e15efd.tar.xz
adventofcode2017-f4e01b6401a224fddc3143b15031c6ef60e15efd.zip
day14
Diffstat (limited to 'day14.k')
-rw-r--r--day14.k12
1 files changed, 12 insertions, 0 deletions
diff --git a/day14.k b/day14.k
new file mode 100644
index 0000000..a634e17
--- /dev/null
+++ b/day14.k
@@ -0,0 +1,12 @@
+d:*0:`day14    / d:"flqrgnkx"
+
+/ from day10.k
+r:{y@(#y)!x+!#y}
+
+S:256
+k:{(r[-m](|y#R),y_R:r[m:S!x 1]@*x;+/y,x 1 2;1+x 2)}
+h:{,/+S\(2/2!+/+2\)'16 0N#*64 k/[;0+x,17 31 73 47 23]/(!S;0;0)}
+
+/ adapted from ok/examples/islands.k by John Earnest
++/+/a:+0,'+(0,,/+2\h@d,"-",)'$!128				/ 8226
+-1+#?,/{a*|/(,x),((-1 1)r'\:x),(-1 1)r\:x}/a*s#1+!*/s:2##a	/ 1128