aboutsummaryrefslogtreecommitdiff
path: root/2019/one.nim
diff options
context:
space:
mode:
authorj-james2022-12-12 02:15:44 +0000
committerj-james2022-12-12 02:18:55 +0000
commita7ba598a54a8883c83cb9ef2b04d653eecd92e28 (patch)
tree06d362d3a88c615d8747ddf9a961bf491a8575a5 /2019/one.nim
parent13007178188cd89b31e3e41090e8a8ed64867c13 (diff)
Reorganize 2019 solutions
Diffstat (limited to '2019/one.nim')
-rw-r--r--2019/one.nim16
1 files changed, 0 insertions, 16 deletions
diff --git a/2019/one.nim b/2019/one.nim
deleted file mode 100644
index 63c1219..0000000
--- a/2019/one.nim
+++ /dev/null
@@ -1,16 +0,0 @@
-# Day One: The Tyranny of the Rocket Equation
-import os, strutils
-
-let input: string = paramStr(1)
-var sum, fuelsum: int = 0
-
-for mass in lines(input):
- var fuel = parseInt(mass) div 3 - 2
- sum += fuel
- fuelsum += fuel
- while fuel > 0:
- fuel = fuel div 3 - 2
- fuelsum += max(0, fuel)
-
-echo sum
-echo fuelsum