about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--day149
-rw-r--r--day14.k10
2 files changed, 19 insertions, 0 deletions
diff --git a/day14 b/day14
new file mode 100644
index 0000000..1532578
--- /dev/null
+++ b/day14
@@ -0,0 +1,9 @@
+Vixen can fly 8 km/s for 8 seconds, but then must rest for 53 seconds.
+Blitzen can fly 13 km/s for 4 seconds, but then must rest for 49 seconds.
+Rudolph can fly 20 km/s for 7 seconds, but then must rest for 132 seconds.
+Cupid can fly 12 km/s for 4 seconds, but then must rest for 43 seconds.
+Donner can fly 9 km/s for 5 seconds, but then must rest for 38 seconds.
+Dasher can fly 10 km/s for 4 seconds, but then must rest for 37 seconds.
+Comet can fly 3 km/s for 37 seconds, but then must rest for 76 seconds.
+Prancer can fly 9 km/s for 12 seconds, but then must rest for 97 seconds.
+Dancer can fly 37 km/s for 1 seconds, but then must rest for 36 seconds.
diff --git a/day14.k b/day14.k
new file mode 100644
index 0000000..995bcfb
--- /dev/null
+++ b/day14.k
@@ -0,0 +1,10 @@
+d:0:"day14";
+t:2503;
+
+ss:{1 _' (&y=y,x) _ y,x}; / split x at y
+l:ss[;" "]' d;
+
+r:+{t#((0$x@6)#0$x@3),(0$x@13)#0}'l; / incremental distance at second
+
+|/+/r
+|/+/{x=|/x}'+\r