about summary refs log tree commit diff
path: root/day12.k
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-12 16:14:01 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-12 16:14:01 +0100
commitb0b91e6128d48be95f21cc6172b0403256fc55e1 (patch)
treed890840100a688af29082a2ab772d2ea69658696 /day12.k
parentd8069ac1178ee09c1a05b26186afd3c35fe4bda3 (diff)
downloadadventofcode2016-b0b91e6128d48be95f21cc6172b0403256fc55e1.tar.gz
adventofcode2016-b0b91e6128d48be95f21cc6172b0403256fc55e1.tar.xz
adventofcode2016-b0b91e6128d48be95f21cc6172b0403256fc55e1.zip
day12
Diffstat (limited to 'day12.k')
-rw-r--r--day12.k7
1 files changed, 7 insertions, 0 deletions
diff --git a/day12.k b/day12.k
new file mode 100644
index 0000000..8c6971b
--- /dev/null
+++ b/day12.k
@@ -0,0 +1,7 @@
+p:" "\'0:"day12"
+v:{(r,"i"$,x)"abcd"?*x}
+e:{t:"abcd"?*|c:p[i]; i+:1; s:~[**c;]
+ $[s"c";r[t]:v@c@1; s"i";r[t]+:1; s"d";r[t]-:1; s"j";i+:(-1+v@*|c)*~0=v@c@1];r}
+
+r:4#0;i:0;*{i<#p}e/1		/ 318077
+r:0 0 1 0;i:0;*{i<#p}e/1	/ 9227731