about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-03 22:01:59 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-03 22:01:59 +0100
commit53e47a52d853a357378a36624f946f16baa61142 (patch)
treea99183da0f25a7d7679ad540ed74da8a70da17c4
parent273503ded9bc284881c986442da8f1c29f897528 (diff)
downloadadventofcode2016-53e47a52d853a357378a36624f946f16baa61142.tar.gz
adventofcode2016-53e47a52d853a357378a36624f946f16baa61142.tar.xz
adventofcode2016-53e47a52d853a357378a36624f946f16baa61142.zip
day02: rotated 45 version
-rw-r--r--day02.k22
1 files changed, 22 insertions, 0 deletions
diff --git a/day02.k b/day02.k
index 56b84e8..65b5f0e 100644
--- a/day02.k
+++ b/day02.k
@@ -3,9 +3,31 @@
 ,/$.[3 3#1+!9]'1+'((-1|1&+)/(,/-:\|=2)"RDLU"?)',\0:"day02"
 / 56983
 
+/ with John Earnest
+10/1+3/'((2&0|+)/(,/-:\|=2)"RDLU"?)',\0:"day02"
+10/1+3/'(2&0|+)/',\("RDLU"!,/-:\|=2)@0:"day02"
+
 m:{$[2<+/{%x*x}x+y; x; x+y]}
 m:{$[4<+/u*u:x+y;x;u]}
 ,/.[5 5#"zz1zzz234z56789zABCzzzD"]'2+'(m/(,/-:\|=2)"RDLU"?)',\0:"day02"
 / 8B8B1
 
+n:{$[3>|/v|-v:x+y;v;x]}
+,/.[5 5#"1z4z9z3z8z2z7zCz6zBz5zAzD"]'2+'(n/(-1 1;1 1;1 -1;-1 -1)"RDLU"?)',\0:"day02"
+"1z4z9z3z8z2z7zCz6zBz5zAzD"@5/'2+'(n/(-1 1;1 1;1 -1;-1 -1)"RDLU"?)',\0:"day02"
+"1493827C6B5AD"`i$(5/'2+'(n/(-1 1;1 1;1 -1;-1 -1)"RDLU"?)',\0:"day02")%2
+"1493827C6B5AD"`i$(5/'2+'(n/(m,-m:(-1 1;1 1))"RDLU"?)',\0:"day02")%2
+
 \\
+
+1 4 9
+ 3 8
+2 7 C
+ 6 B
+5 A D
+
+  1
+ 234
+56789
+ ABC
+  D