about summary refs log tree commit diff
path: root/day3.k
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-12-06 20:12:58 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-12-06 20:12:58 +0100
commit90e1438863b710e9e19a6208d2e1fd953bfdec2a (patch)
tree0485f9d2624b79cfcc9a97ff97db1b4bcbd7ba6e /day3.k
parent109d688f12f4f36b8d4d12f178b4e42ebdf02ffa (diff)
downloadadventofcode2015-90e1438863b710e9e19a6208d2e1fd953bfdec2a.tar.gz
adventofcode2015-90e1438863b710e9e19a6208d2e1fd953bfdec2a.tar.xz
adventofcode2015-90e1438863b710e9e19a6208d2e1fd953bfdec2a.zip
day3
Diffstat (limited to 'day3.k')
-rw-r--r--day3.k10
1 files changed, 10 insertions, 0 deletions
diff --git a/day3.k b/day3.k
new file mode 100644
index 0000000..f4e8791
--- /dev/null
+++ b/day3.k
@@ -0,0 +1,10 @@
+d: *0:"day3";
+/ with case z:{:[x=">";1 0;x="<";-1 0;x="^";0 1;x="v";0 -1; 0 0]}'d;
+z: (1 0;-1 0;0 1;0 -1) @ "<>^v"?/:d;
+u: {x@*:'=x};
+r: u@ +\ (, 0 0) , z;
+#r
+
+z2: + -1 2 # z; / alternating split
+r2: u@ ,/ +\' (,0 0) ,/: z2;
+#r2