--- /dev/null
+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)));
+
+++ /dev/null
-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)));
-