about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Day1.cs2
-rw-r--r--Day2.cs2
-rw-r--r--Day4.cs12
-rw-r--r--Day5.cs9
4 files changed, 12 insertions, 13 deletions
diff --git a/Day1.cs b/Day1.cs
index b5d8612..dd57645 100644
--- a/Day1.cs
+++ b/Day1.cs
@@ -8,7 +8,7 @@ namespace aoc2019
     {
         public override int DayNumber => 1;
 
-        private static readonly IEnumerable<int> masses =
+        private readonly IEnumerable<int> masses =
             File.ReadLines("input/day1.in").Select(int.Parse);
 
         private static int FuelCost(int weight) => weight / 3 - 2;
diff --git a/Day2.cs b/Day2.cs
index e469bcc..095b454 100644
--- a/Day2.cs
+++ b/Day2.cs
@@ -8,7 +8,7 @@ namespace aoc2019
     {
         public override int DayNumber => 2;
 
-        private static readonly IEnumerable<int> input =
+        private readonly IEnumerable<int> input =
             File.ReadLines("input/day2.in").First().Split(',').Select(int.Parse);
 
         public static List<int> RunIntCode(int noun, int verb, List<int> v)
diff --git a/Day4.cs b/Day4.cs
index 7394f3d..1a7ece7 100644
--- a/Day4.cs
+++ b/Day4.cs
@@ -32,20 +32,20 @@ namespace aoc2019
             return i >= start && i <= end && hasDup;
         }
 
-        public override string Part1()
-        {
-            return $"{Enumerable.Range(start, end).Count(IsValid)}";
-        }
-
         private bool HasOnePair(int i)
         {
             var s = i.ToString();
             return IsValid(i) && s.Select(c => s.Count(j => j == c)).Any(c => c == 2);
         }
 
+        public override string Part1()
+        {
+            return $"{Enumerable.Range(start, end).Count(IsValid)}";
+        }
+
         public override string Part2()
         {
-            return $"{Enumerable.Range(start,end).Count(HasOnePair)}";
+            return $"{Enumerable.Range(start, end).Count(HasOnePair)}";
         }
     }
 }
diff --git a/Day5.cs b/Day5.cs
index 3bbaa4c..ca9a08f 100644
--- a/Day5.cs
+++ b/Day5.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 
@@ -9,11 +8,11 @@ namespace aoc2019
     {
         public override int DayNumber => 5;
 
-        private static readonly IEnumerable<int> tape =
+        private readonly IEnumerable<int> tape =
             File.ReadLines("input/day5.in").First().Split(',').Select(int.Parse);
 
-        private static int output;
-        public static void RunIntCode(List<int> v, int input)
+        private int output;
+        public void RunIntCode(List<int> v, int input)
         {
             var i = 0;
             while (i < v.Count && v[i] != 99)