aboutsummaryrefslogtreecommitdiff
path: root/2015/14/puzzle-1.bc
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-11-30 12:23:17 +0100
committerThomas Voss <mail@thomasvoss.com> 2022-11-30 12:23:17 +0100
commitf3e3e3e354b87f4ce27bd74bf14cec05d06974b6 (patch)
tree112352e9c3ba5d5d924036def2b5f853d3f8dc28 /2015/14/puzzle-1.bc
parent4742dd73046c53cff7fe54deee58358c3b193206 (diff)
Lots of cleanup and stuff
Diffstat (limited to '2015/14/puzzle-1.bc')
-rw-r--r--2015/14/puzzle-1.bc10
1 files changed, 4 insertions, 6 deletions
diff --git a/2015/14/puzzle-1.bc b/2015/14/puzzle-1.bc
index d36cafd..1ccab06 100644
--- a/2015/14/puzzle-1.bc
+++ b/2015/14/puzzle-1.bc
@@ -1,6 +1,5 @@
/* Return the largest element from array `a` of length `l` */
-define max(a[], l)
-{
+define max(a[], l) {
auto m, i
for (i = 0; i < l; i++) {
if (a[i] > m)
@@ -9,11 +8,10 @@ define max(a[], l)
return m
}
-/* Return the kilometers traveled by a raindeer that flys with speed `s` km/s for `t` seconds before
- * needing to rest for `r` seconds.
+/* Return the kilometers traveled by a raindeer that flys with speed `s` km/s
+ * for `t` seconds before needing to rest for `r` seconds.
*/
-define calc(s, t, r)
-{
+define calc(s, t, r) {
auto a, d
while (d + t <= 2503) {
a += s * t