]> code.bitgloo.com Git - clyne/advent-of-code.git/commitdiff
day7: fix file extension
authorClyne Sullivan <clyne@bitgloo.com>
Tue, 7 Dec 2021 19:49:00 +0000 (14:49 -0500)
committerClyne Sullivan <clyne@bitgloo.com>
Tue, 7 Dec 2021 19:49:00 +0000 (14:49 -0500)
day7/maxima.mac [new file with mode: 0644]
day7/maxima.mx [deleted file]

diff --git a/day7/maxima.mac b/day7/maxima.mac
new file mode 100644 (file)
index 0000000..a1c2d18
--- /dev/null
@@ -0,0 +1,10 @@
+load("descriptive")$
+load("in.mac")$ /* Should define `input` list of numbers. */
+
+calcfuel(pos, distmod) :=
+    lreduce("+", map(lambda([n], distmod(abs(pos - n))), input))$
+
+calcfuel(median(input), lambda([x],x));
+calcfuel(floor(mean(input)), lambda([x], (x*(x+1)/2)));
+calcfuel(floor(mean(input)) + 1, lambda([x], (x*(x+1)/2)));
+
diff --git a/day7/maxima.mx b/day7/maxima.mx
deleted file mode 100644 (file)
index 4625fdc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-load("descriptive")$
-batchload("./in.mx")$ /* Should define `input` list of numbers. */
-
-calcfuel(pos, distmod) :=
-    lreduce("+", map(lambda([n], distmod(abs(pos - n))), input))$
-
-calcfuel(median(input), lambda([x],x));
-calcfuel(floor(mean(input)), lambda([x], (x*(x+1)/2)));
-calcfuel(floor(mean(input)) + 1, lambda([x], (x*(x+1)/2)));
-