about summary refs log tree commit diff
path: root/day3.k
diff options
context:
space:
mode:
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