about summary refs log tree commit diff
path: root/Day1.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Day1.cs')
-rw-r--r--Day1.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Day1.cs b/Day1.cs
index 570d017..186c7b4 100644
--- a/Day1.cs
+++ b/Day1.cs
@@ -5,21 +5,21 @@ using System.Linq;
 
 namespace aoc2019
 {
-    public class Day1
+    public class Day1 : Day
     {
-        private static IEnumerable<int> lines = 
+        private static readonly IEnumerable<int> lines =
             File.ReadLines("input/day1.in").Select(line => int.Parse(line));
 
         private static int FuelCost(int weight) => weight / 3 - 2;
 
-        public static void Part1()
+        public override void Part1()
         {
             Console.WriteLine(lines.Select(num => FuelCost(num)).Sum());
         }
 
         private static int FullCost(int cost)
         {
-            int total = 0, newcost = 0, tmp = cost;
+            int total = 0, newcost, tmp = cost;
 
             while ((newcost = FuelCost(tmp)) >= 0)
             {
@@ -30,7 +30,7 @@ namespace aoc2019
             return total;
         }
 
-        public static void Part2()
+        public override void Part2()
         {
             Console.WriteLine(lines.Select(cost => FullCost(cost)).Sum());
         }