about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-12-01 17:32:12 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-12-01 17:32:12 +0100
commit719d1cc73e191a30cc6624d6a4d9a10ecea8ab01 (patch)
tree266d9d5ed4122cb0975350abe0d016324cfbbe92
parent27f7de20db72a24d68f794f9b166afa9420b3448 (diff)
downloadadventofcode2016-719d1cc73e191a30cc6624d6a4d9a10ecea8ab01.tar.gz
adventofcode2016-719d1cc73e191a30cc6624d6a4d9a10ecea8ab01.tar.xz
adventofcode2016-719d1cc73e191a30cc6624d6a4d9a10ecea8ab01.zip
day01
-rw-r--r--day011
-rw-r--r--day01.ijs12
-rw-r--r--day01.k10
-rw-r--r--day01.ok8
4 files changed, 31 insertions, 0 deletions
diff --git a/day01 b/day01
new file mode 100644
index 0000000..34a1e76
--- /dev/null
+++ b/day01
@@ -0,0 +1 @@
+R4, R4, L1, R3, L5, R2, R5, R1, L4, R3, L5, R2, L3, L4, L3, R1, R5, R1, L3, L1, R3, L1, R2, R2, L2, R5, L3, L4, R4, R4, R2, L4, L1, R5, L1, L4, R4, L1, R1, L2, R5, L2, L3, R2, R1, L194, R2, L4, R49, R1, R3, L5, L4, L1, R4, R2, R1, L5, R3, L5, L4, R4, R4, L2, L3, R78, L5, R4, R191, R4, R3, R1, L2, R1, R3, L1, R3, R4, R2, L2, R1, R4, L5, R2, L2, L4, L2, R1, R2, L3, R5, R2, L3, L3, R3, L1, L1, R5, L4, L4, L2, R5, R1, R4, L3, L5, L4, R5, L4, R5, R4, L3, L2, L5, R4, R3, L3, R1, L5, R5, R1, L3, R2, L5, R5, L3, R1, R4, L5, R4, R2, R3, L4, L5, R3, R4, L5, L5, R4, L4, L4, R1, R5, R3, L1, L4, L3, L4, R1, L5, L1, R2, R2, R4, R4, L5, R4, R1, L1, L1, L3, L5, L2, R4, L3, L5, L4, L1, R3
\ No newline at end of file
diff --git a/day01.ijs b/day01.ijs
new file mode 100644
index 0000000..6b0dfce
--- /dev/null
+++ b/day01.ijs
@@ -0,0 +1,12 @@
+d=: }."1 ;._1', ',(1!:1<'day01')
+
+p=: [: +/ [: |"1 [: +. [
+
+t=: */\0j1*<:+:'R'= {."1 d
+l=: 0". }."1 d
+echo p +/l*t
+
+fd=: [ {~ 0 i.~ [: ~: [
+echo p fd +/\t{~I.l
+
+exit 0
diff --git a/day01.k b/day01.k
new file mode 100644
index 0000000..30ba09f
--- /dev/null
+++ b/day01.k
@@ -0,0 +1,10 @@
+d:" "\(*0:"day01")^","
+
+t: (1 0;0 1;-1 0;0 -1)@4!+\-1+2*"R"=d[;0]
+l: "i"$1_'d
++/{%x*x}+/t*l			/ 146
+
+fd:{x@*&{1<#x}'.=x}
++/{%x*x}fd@+\t@&l		/ 131
+
+\\
diff --git a/day01.ok b/day01.ok
new file mode 100644
index 0000000..d544b61
--- /dev/null
+++ b/day01.ok
@@ -0,0 +1,8 @@
+d:" "\(*0:"day01")^","
+
+t: (1 0;0 1;-1 0;0 -1)@4!+\-1+2*"R"=d[;0]
+l: .:'1_'d
++/{%x*x}@+/t*l			/ 146
+
+fd:{x@*&{1<#x}'.=x}
++/{%x*x}@fd@+\t@&l		/ 131