about summary refs log tree commit diff
path: root/Day5.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-12-02 00:36:24 -0500
committerBen Harris <ben@tilde.team>2020-12-02 00:36:24 -0500
commit36bb28af87e81a9b3cab1abd79d11106cd610f6c (patch)
treed4648bba69ceb5e20753acf54df51d74cff4731b /Day5.cs
parent00c3b51b897c33210679de546eebcd9ec75247a1 (diff)
update gitignore and run resharper cleanup
Diffstat (limited to 'Day5.cs')
-rw-r--r--Day5.cs17
1 files changed, 11 insertions, 6 deletions
diff --git a/Day5.cs b/Day5.cs
index fc360aa..88465db 100644
--- a/Day5.cs
+++ b/Day5.cs
@@ -5,22 +5,26 @@ namespace aoc2019
 {
     internal sealed class Day5 : Day
     {
-        public override int DayNumber => 5;
-
         private readonly IEnumerable<int> tape;
+
+        private int output;
+
         public Day5()
         {
             tape = Input.First().Split(',').Select(int.Parse);
         }
 
-        private int output;
+        public override int DayNumber => 5;
+
         public void RunIntCode(List<int> v, int input)
         {
             var i = 0;
             while (i < v.Count && v[i] != 99)
             {
-                int Val(int mode, int val) =>
-                    mode != 0 ? val : v[val];
+                int Val(int mode, int val)
+                {
+                    return mode != 0 ? val : v[val];
+                }
 
                 var mode1 = v[i] / 100 % 10;
                 var mode2 = v[i] / 1000;
@@ -60,6 +64,7 @@ namespace aoc2019
                 }
             }
         }
+
         public override string Part1()
         {
             RunIntCode(tape.ToList(), 1);
@@ -72,4 +77,4 @@ namespace aoc2019
             return $"{output}";
         }
     }
-}
+}
\ No newline at end of file