aboutsummaryrefslogtreecommitdiff
path: root/day12.k
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-12-12 14:57:41 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-12-12 14:57:41 +0100
commitbfab0ac65ae9860285c66704e260dde434d5da1f (patch)
tree49da0d2bedc8f15f38c8a0b1dbbc59d835c6d730 /day12.k
parent54b99d9049559d9c562ed27bdad0dc855141878d (diff)
downloadadventofcode2015-bfab0ac65ae9860285c66704e260dde434d5da1f.tar.gz
adventofcode2015-bfab0ac65ae9860285c66704e260dde434d5da1f.tar.xz
adventofcode2015-bfab0ac65ae9860285c66704e260dde434d5da1f.zip
day12
Diffstat (limited to 'day12.k')
-rw-r--r--day12.k10
1 files changed, 10 insertions, 0 deletions
diff --git a/day12.k b/day12.k
new file mode 100644
index 0000000..4897efe
--- /dev/null
+++ b/day12.k
@@ -0,0 +1,10 @@
+/ k4/q with json.k loaded
+d: .j.k@,/0::`day12
+
+s1:{$[(0=@x)|(98=@x)|(9=@x);+/.z.s'x; 99=@x;.z.s@.:x; 0>@x;x; 0]}
+s1 d
+
+check:{~#&x~\:y}
+
+s2:{$[(0=@x)|(98=@x)|(9=@x);+/.z.s'x; 99=@x;check[.:x;"red"]*.z.s@.:x; 0>@x;x; 0]}
+s2 d