about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-03 22:01:55 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-03 22:01:55 +0100
commit273503ded9bc284881c986442da8f1c29f897528 (patch)
treed596dd00cb3e984f448761575ffd4f80546b97e6
parent0d7e832dd83de4b65c13547d939ff54c275ed0b7 (diff)
downloadadventofcode2016-273503ded9bc284881c986442da8f1c29f897528.tar.gz
adventofcode2016-273503ded9bc284881c986442da8f1c29f897528.tar.xz
adventofcode2016-273503ded9bc284881c986442da8f1c29f897528.zip
day03: tweaks
-rw-r--r--day032
-rw-r--r--day03.ijs7
-rw-r--r--day03.k6
-rw-r--r--day03.ok2
4 files changed, 14 insertions, 3 deletions
diff --git a/day03 b/day03
index b8e5272..79b3444 100644
--- a/day03
+++ b/day03
@@ -1908,4 +1908,4 @@
   957  170  454
   466   88  293
    40  813  103
-  436  766  254
+  436  766  254
\ No newline at end of file
diff --git a/day03.ijs b/day03.ijs
new file mode 100644
index 0000000..40a5473
--- /dev/null
+++ b/day03.ijs
@@ -0,0 +1,7 @@
+load 'files'
+
+c =: 13 : '(>./x)<(+/x)-(>./x)'
+echo +/c"1".freadr'day03'
+echo +/c"1,/((3%~#r),3)$"1|:r=:".freadr'day03'
+
+exit 0
diff --git a/day03.k b/day03.k
index 58d42c0..71bc6db 100644
--- a/day03.k
+++ b/day03.k
@@ -1,6 +1,8 @@
-+/{h<(+/x)-h:|/x}'"i"$'(" "\'0:"day03")^\:,""
-+/{h<(+/x)-h:|/x}',/+:'0N 3 #"i"$'(" "\'0:"day03")^\:,""
++/{h<(+/x)-h:|/x}'"i"$'(" "\'0:"day03")^\:,""			/ 993
++/{h<(+/x)-h:|/x}',/+:'0N 3 #"i"$'(" "\'0:"day03")^\:,""	/ 1849
 
 / thanks to John Earnest
 +/{h<(+/x)-h:|/x}'.:'0:"day03"
 +/{h<(+/x)-h:|/x}',/+:'0N 3 #.:'0:"day03"
+
+\\
diff --git a/day03.ok b/day03.ok
new file mode 100644
index 0000000..188ef95
--- /dev/null
+++ b/day03.ok
@@ -0,0 +1,2 @@
++/{h<(+/x)-h:|/x}'.:' 0:"day03"
++/{h<(+/x)-h:|/x}',/+:'0N 3 #.:' 0:"day03"