about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Day.cs6
-rw-r--r--Day1.cs4
-rw-r--r--Day10.cs4
-rw-r--r--Day11.cs4
-rw-r--r--Day12.cs4
-rw-r--r--Day13.cs4
-rw-r--r--Day14.cs4
-rw-r--r--Day15.cs4
-rw-r--r--Day16.cs4
-rw-r--r--Day2.cs4
-rw-r--r--Day3.cs4
-rw-r--r--Day4.cs4
-rw-r--r--Day5.cs4
-rw-r--r--Day6.cs4
-rw-r--r--Day7.cs4
-rw-r--r--Day8.cs4
-rw-r--r--Day9.cs4
17 files changed, 35 insertions, 35 deletions
diff --git a/Day.cs b/Day.cs
index d8e7e7c..f08e7cf 100644
--- a/Day.cs
+++ b/Day.cs
@@ -9,7 +9,7 @@ namespace aoc2019
     {
         public abstract int DayNumber { get; }
 
-        public virtual IEnumerable<string> Input =>
+        protected virtual IEnumerable<string> Input =>
             File.ReadLines($"input/day{DayNumber}.in");
 
         public virtual void AllParts(bool verbose = false)
@@ -31,7 +31,7 @@ namespace aoc2019
             Console.WriteLine();
         }
 
-        public abstract string Part1();
-        public abstract string Part2();
+        protected abstract string Part1();
+        protected abstract string Part2();
     }
 }
\ No newline at end of file
diff --git a/Day1.cs b/Day1.cs
index 979db5f..1e9abef 100644
--- a/Day1.cs
+++ b/Day1.cs
@@ -32,12 +32,12 @@ namespace aoc2019
             return total;
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             return $"{masses.Sum(FuelCost)}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             return $"{masses.Sum(FullCost)}";
         }
diff --git a/Day10.cs b/Day10.cs
index 5886556..4cdaa49 100644
--- a/Day10.cs
+++ b/Day10.cs
@@ -23,7 +23,7 @@ namespace aoc2019
 
         public override int DayNumber => 10;
 
-        public override string Part1()
+        protected override string Part1()
         {
             foreach (var asteroid in asteroids)
             {
@@ -43,7 +43,7 @@ namespace aoc2019
             return $"{bestcansee}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             static IEnumerable<(int x, int y, double angle, double dist)> GetValue(
                 Queue<(int x, int y, double angle, double dist)> q)
diff --git a/Day11.cs b/Day11.cs
index 647be9a..6900d48 100644
--- a/Day11.cs
+++ b/Day11.cs
@@ -80,12 +80,12 @@ namespace aoc2019
             return map;
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             return $"{PaintShip(0).Count}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             var map = PaintShip(1);
             var minX = (int) map.Keys.Select(x => x.x).Min();
diff --git a/Day12.cs b/Day12.cs
index 4d6178a..7d61b63 100644
--- a/Day12.cs
+++ b/Day12.cs
@@ -53,7 +53,7 @@ namespace aoc2019
             step++;
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             while (step < 1000)
                 Step();
@@ -61,7 +61,7 @@ namespace aoc2019
             return $"{moons.Sum(p => p.TotalEnergy)}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             int cycleX = 0, cycleY = 0, cycleZ = 0;
 
diff --git a/Day13.cs b/Day13.cs
index 17e053d..47476e5 100644
--- a/Day13.cs
+++ b/Day13.cs
@@ -55,14 +55,14 @@ namespace aoc2019
             }
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             vm.Reset();
             vm.Run();
             return $"{vm.output.Where((v, i) => (i + 1) % 3 == 0 && v == 2).Count()}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             vm.Reset();
             vm.memory[0] = 2;
diff --git a/Day14.cs b/Day14.cs
index 1aff2bf..910c43a 100644
--- a/Day14.cs
+++ b/Day14.cs
@@ -50,14 +50,14 @@ namespace aoc2019
             return true;
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             available = new Dictionary<string, long> {{"ORE", long.MaxValue}};
             Consume("FUEL", 1);
             return $"{long.MaxValue - available["ORE"]}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             const long capacity = 1_000_000_000_000;
             available = new Dictionary<string, long> {{"ORE", capacity}};
diff --git a/Day15.cs b/Day15.cs
index 487030f..fa2d510 100644
--- a/Day15.cs
+++ b/Day15.cs
@@ -14,12 +14,12 @@ namespace aoc2019
 
         public override int DayNumber => 15;
 
-        public override string Part1()
+        protected override string Part1()
         {
             return "intcode solution";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             return "";
         }
diff --git a/Day16.cs b/Day16.cs
index 7baa2c9..ce7e7e0 100644
--- a/Day16.cs
+++ b/Day16.cs
@@ -4,12 +4,12 @@ namespace aoc2019
     {
         public override int DayNumber => 16;
 
-        public override string Part1()
+        protected override string Part1()
         {
             return "";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             return "";
         }
diff --git a/Day2.cs b/Day2.cs
index f4b11e6..1022cfe 100644
--- a/Day2.cs
+++ b/Day2.cs
@@ -30,12 +30,12 @@ namespace aoc2019
             return v[0];
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             return $"{RunIntCode(12, 2)}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             for (var i = 0; i < 100; i++)
             for (var j = 0; j < 100; j++)
diff --git a/Day3.cs b/Day3.cs
index 12f10d4..03f7379 100644
--- a/Day3.cs
+++ b/Day3.cs
@@ -17,12 +17,12 @@ namespace aoc2019
 
         public override int DayNumber => 3;
 
-        public override string Part1()
+        protected override string Part1()
         {
             return $"{intersections.Min(x => Math.Abs(x.Item1) + Math.Abs(x.Item2))}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             // add 2 to count (0, 0) on both lines
             return $"{intersections.Min(x => wires[0][x] + wires[1][x]) + 2}";
diff --git a/Day4.cs b/Day4.cs
index 53d335d..60b23b3 100644
--- a/Day4.cs
+++ b/Day4.cs
@@ -38,12 +38,12 @@ namespace aoc2019
             return IsValid(i) && s.Select(c => s.Count(j => j == c)).Any(c => c == 2);
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             return $"{Enumerable.Range(start, end).Count(IsValid)}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             return $"{Enumerable.Range(start, end).Count(HasOnePair)}";
         }
diff --git a/Day5.cs b/Day5.cs
index 88465db..e599d16 100644
--- a/Day5.cs
+++ b/Day5.cs
@@ -65,13 +65,13 @@ namespace aoc2019
             }
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             RunIntCode(tape.ToList(), 1);
             return $"{output}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             RunIntCode(tape.ToList(), 5);
             return $"{output}";
diff --git a/Day6.cs b/Day6.cs
index d92b402..3d5fd3a 100644
--- a/Day6.cs
+++ b/Day6.cs
@@ -23,12 +23,12 @@ namespace aoc2019
             return res;
         }
 
-        public override string Part1()
+        protected override string Part1()
         {
             return $"{input.Keys.Sum(o => GetParents(o).Count - 1)}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             var you = GetParents("YOU");
             var san = GetParents("SAN");
diff --git a/Day7.cs b/Day7.cs
index 123d075..e600361 100644
--- a/Day7.cs
+++ b/Day7.cs
@@ -16,7 +16,7 @@ namespace aoc2019
         public override int DayNumber => 7;
 
 
-        public override string Part1()
+        protected override string Part1()
         {
             long i, largest = 0;
 
@@ -37,7 +37,7 @@ namespace aoc2019
             return $"{largest}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             long i, largest = 0;
 
diff --git a/Day8.cs b/Day8.cs
index 27182ad..cdb3ef6 100644
--- a/Day8.cs
+++ b/Day8.cs
@@ -16,13 +16,13 @@ namespace aoc2019
 
         public override int DayNumber => 8;
 
-        public override string Part1()
+        protected override string Part1()
         {
             var l = photo.OrderBy(layer => layer.Count(pixel => pixel == '0')).First();
             return $"{l.Count(p => p == '1') * l.Count(p => p == '2')}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             return Enumerable.Range(0, 25 * 6)
                 .Select(p => Enumerable.Range(0, photo.Count)
diff --git a/Day9.cs b/Day9.cs
index 77e72e1..a50fdd9 100644
--- a/Day9.cs
+++ b/Day9.cs
@@ -14,14 +14,14 @@ namespace aoc2019
 
         public override int DayNumber => 9;
 
-        public override string Part1()
+        protected override string Part1()
         {
             vm.Reset();
             vm.Run(1);
             return $"{vm.output.ToDelimitedString(",")}";
         }
 
-        public override string Part2()
+        protected override string Part2()
         {
             vm.Reset();
             vm.Run(2);