diff --git a/AdventOfCode/AOC.Tests/Y2015/Day01.cs b/AdventOfCode/AOC.Tests/Y2015/Day01.cs index a89d303..1cbfd0d 100644 --- a/AdventOfCode/AOC.Tests/Y2015/Day01.cs +++ b/AdventOfCode/AOC.Tests/Y2015/Day01.cs @@ -24,7 +24,7 @@ namespace AOC.Tests.Y2015 [TestCase(")))", -3)] // Example data [TestCase(")())())", -3)] // Example data [TestCase(null, 232)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { var lines = input != null ? input : realData; @@ -45,7 +45,7 @@ namespace AOC.Tests.Y2015 [TestCase(")", 1)] // Example data [TestCase("()())", 5)] [TestCase(null, 1783)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { var lines = input != null ? input : realData; @@ -79,4 +79,4 @@ namespace AOC.Tests.Y2015 Console.WriteLine($"Part 2: {result}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2015/Day02.cs b/AdventOfCode/AOC.Tests/Y2015/Day02.cs index 1c88ae4..228af27 100644 --- a/AdventOfCode/AOC.Tests/Y2015/Day02.cs +++ b/AdventOfCode/AOC.Tests/Y2015/Day02.cs @@ -18,7 +18,7 @@ namespace AOC.Tests.Y2015 [TestCase("2x3x4", 58)] [TestCase("1x1x10", 43)] [TestCase(null, 1606483)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? new[] { input } : realData; @@ -53,7 +53,7 @@ namespace AOC.Tests.Y2015 [TestCase("2x3x4", 34)] [TestCase("1x1x10", 14)] [TestCase(null, 3842356)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? new[] { input } : realData; @@ -86,4 +86,4 @@ namespace AOC.Tests.Y2015 Console.WriteLine($"Part 2: {totalRibbon}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2015/Day03.cs b/AdventOfCode/AOC.Tests/Y2015/Day03.cs index 7f7b458..7983345 100644 --- a/AdventOfCode/AOC.Tests/Y2015/Day03.cs +++ b/AdventOfCode/AOC.Tests/Y2015/Day03.cs @@ -47,7 +47,7 @@ namespace AOC.Tests.Y2015 [TestCase("^>v<", 4)] [TestCase("^v^v^v^v^v", 2)] [TestCase(null, 2565)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string lines = input != null ? input : realData; int currentX = 0; @@ -102,7 +102,7 @@ namespace AOC.Tests.Y2015 [TestCase("^>v<", 3)] [TestCase("^v^v^v^v^v", 11)] [TestCase(null, 2639)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string lines = input != null ? input : realData; int currentX = 0; @@ -194,4 +194,4 @@ namespace AOC.Tests.Y2015 Console.WriteLine($"Part 2: {numberOfHousesVisited}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2015/Day04.cs b/AdventOfCode/AOC.Tests/Y2015/Day04.cs index 6e749d5..de53a5c 100644 --- a/AdventOfCode/AOC.Tests/Y2015/Day04.cs +++ b/AdventOfCode/AOC.Tests/Y2015/Day04.cs @@ -46,7 +46,7 @@ namespace AOC.Tests.Y2015 [TestCase("abcdef", 609043)] [TestCase("pqrstuv", 1048970)] [TestCase(null, 254575)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string lines = input != null ? input : realData; @@ -61,7 +61,7 @@ namespace AOC.Tests.Y2015 } [TestCase(null, 1038736)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string lines = input != null ? input : realData; @@ -75,4 +75,4 @@ namespace AOC.Tests.Y2015 Console.WriteLine($"Part 2: {i}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2015/Day05.cs b/AdventOfCode/AOC.Tests/Y2015/Day05.cs index cf0749a..d3c8608 100644 --- a/AdventOfCode/AOC.Tests/Y2015/Day05.cs +++ b/AdventOfCode/AOC.Tests/Y2015/Day05.cs @@ -139,7 +139,7 @@ namespace AOC.Tests.Y2015 [TestCase("haegwjzuvuyypxyu", 0)] [TestCase("dvszwmarrgswjxmb", 0)] [TestCase(null, 258)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? new[] { input } : realData; @@ -166,7 +166,7 @@ namespace AOC.Tests.Y2015 [TestCase("uurcxstgmygtbstg", 0)] [TestCase("ieodomkazucvgmuy", 0)] [TestCase(null, 53)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? new[] { input } : realData; @@ -188,4 +188,4 @@ namespace AOC.Tests.Y2015 Console.WriteLine($"Part 2: {niceCount}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2015/Day06.cs b/AdventOfCode/AOC.Tests/Y2015/Day06.cs index 29cf2ce..5ab48a8 100644 --- a/AdventOfCode/AOC.Tests/Y2015/Day06.cs +++ b/AdventOfCode/AOC.Tests/Y2015/Day06.cs @@ -93,7 +93,7 @@ namespace AOC.Tests.Y2015 [TestCase("toggle 0,0 through 999,0", 1000)] [TestCase("turn on 0,0 through 999,999/nturn off 499,499 through 500,500", 999996)] [TestCase(null, 400410)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("/n") : realData; @@ -121,7 +121,7 @@ namespace AOC.Tests.Y2015 [TestCase("turn on 0,0 through 0,0", 1)] [TestCase("toggle 0,0 through 999,999", 2000000)] [TestCase(null, 15343601)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("/n") : realData; @@ -142,4 +142,4 @@ namespace AOC.Tests.Y2015 Console.WriteLine($"Part 2: {totalBrightness}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2021/Day01.cs b/AdventOfCode/AOC.Tests/Y2021/Day01.cs index 543cb3d..37c2414 100644 --- a/AdventOfCode/AOC.Tests/Y2021/Day01.cs +++ b/AdventOfCode/AOC.Tests/Y2021/Day01.cs @@ -16,7 +16,7 @@ namespace AOC.Tests.Y2021 [TestCase("199,200,208,210,200,207,240,269,260,263", 7)] // Example data [TestCase(null, 1681)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { var lines = input != null ? input.Split(',') : realData; @@ -46,7 +46,7 @@ namespace AOC.Tests.Y2021 [TestCase("199,200,208,210,200,207,240,269,260,263", 5)] // Example data [TestCase(null, 1704)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { var lines = input != null ? input.Split(',') : realData; @@ -84,4 +84,4 @@ namespace AOC.Tests.Y2021 Console.WriteLine($"Part 2: {numberOfBiggerSlidingTotals}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2022/Day01.cs b/AdventOfCode/AOC.Tests/Y2022/Day01.cs index f9cfc62..df3ebd3 100644 --- a/AdventOfCode/AOC.Tests/Y2022/Day01.cs +++ b/AdventOfCode/AOC.Tests/Y2022/Day01.cs @@ -29,7 +29,7 @@ namespace AOC.Tests.Y2022 10000", 24000)] [TestCase(null, 70764)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -75,7 +75,7 @@ namespace AOC.Tests.Y2022 10000", 45000)] [TestCase(null, 203905)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -107,4 +107,4 @@ namespace AOC.Tests.Y2022 Console.WriteLine($"Part 2: {result}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2022/Day02.cs b/AdventOfCode/AOC.Tests/Y2022/Day02.cs index d17f4d4..0d2e2fb 100644 --- a/AdventOfCode/AOC.Tests/Y2022/Day02.cs +++ b/AdventOfCode/AOC.Tests/Y2022/Day02.cs @@ -18,7 +18,7 @@ namespace AOC.Tests.Y2022 B X C Z", 15)] [TestCase(null, 8392)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -36,7 +36,7 @@ C Z", 15)] B X C Z", 12)] [TestCase(null, 1783)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -174,4 +174,4 @@ C Z", 12)] } } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2022/Day03.cs b/AdventOfCode/AOC.Tests/Y2022/Day03.cs index b08d6cd..0151ad7 100644 --- a/AdventOfCode/AOC.Tests/Y2022/Day03.cs +++ b/AdventOfCode/AOC.Tests/Y2022/Day03.cs @@ -76,7 +76,7 @@ wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn ttgJtRGJQctTZtZT CrZsJsPPZsGzwwsLwLmpwMDw", 157)] [TestCase(null, 8176)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; List items = new(); @@ -112,7 +112,7 @@ wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn ttgJtRGJQctTZtZT CrZsJsPPZsGzwwsLwLmpwMDw", 70)] [TestCase(null, 2689)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; List items = new(); @@ -141,4 +141,4 @@ CrZsJsPPZsGzwwsLwLmpwMDw", 70)] Console.WriteLine($"Part 2: {result}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2023/Day01.cs b/AdventOfCode/AOC.Tests/Y2023/Day01.cs index 99d374e..cdd0e15 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day01.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day01.cs @@ -21,7 +21,7 @@ pqr3stu8vwx a1b2c3d4e5f treb7uchet", 142)] [TestCase(null, 53080)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -60,7 +60,7 @@ zoneight234 [TestCase("three2six8two5", 35)] [TestCase("eightjzqzhrllg1oneightfck", 88)] [TestCase(null, 53268)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -153,4 +153,4 @@ zoneight234 return finalNumber; } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2023/Day02.cs b/AdventOfCode/AOC.Tests/Y2023/Day02.cs index 7d2ae92..8f97fc7 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day02.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day02.cs @@ -37,7 +37,7 @@ Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green", 8)] [TestCase(null, 1734)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -105,7 +105,7 @@ Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green", 2286)] [TestCase(null, 70387)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -175,4 +175,4 @@ Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green", 2286)] Console.WriteLine($"Part 2: {result}"); } } -} \ No newline at end of file +} diff --git a/AdventOfCode/AOC.Tests/Y2023/Day03.cs b/AdventOfCode/AOC.Tests/Y2023/Day03.cs index 2a6a41f..d60961c 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day03.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day03.cs @@ -390,7 +390,7 @@ public class Day03 ...$.*.... .664.598..", 4361)] [TestCase(null, 550934)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -419,7 +419,7 @@ public class Day03 ...$.*.... .664.598..", 467835)] [TestCase(null, 81997870)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; diff --git a/AdventOfCode/AOC.Tests/Y2023/Day04.cs b/AdventOfCode/AOC.Tests/Y2023/Day04.cs index c53903d..fab6392 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day04.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day04.cs @@ -21,7 +21,7 @@ Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83 Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36 Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11", 13)] [TestCase(null, 17782)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -88,7 +88,7 @@ Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83 Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36 Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11", 30)] [TestCase(null, 8477787)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; diff --git a/AdventOfCode/AOC.Tests/Y2023/Day05.cs b/AdventOfCode/AOC.Tests/Y2023/Day05.cs index 21298e4..09c7592 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day05.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day05.cs @@ -112,7 +112,7 @@ humidity-to-location map: 60 56 37 56 93 4", 35)] [TestCase(null, 265018614)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; Almanac almanac = new(); @@ -191,7 +191,7 @@ humidity-to-location map: 60 56 37 56 93 4", 46)] [TestCase(null, 63179500)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; Almanac almanac = new(); diff --git a/AdventOfCode/AOC.Tests/Y2023/Day06.cs b/AdventOfCode/AOC.Tests/Y2023/Day06.cs index 0e305b0..78dd83f 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day06.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day06.cs @@ -17,7 +17,7 @@ public class Day06 [TestCase(@"Time: 7 15 30 Distance: 9 40 200", 288)] [TestCase(null, 1660968)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -82,7 +82,7 @@ Distance: 9 40 200", 288)] [TestCase(@"Time: 7 15 30 Distance: 9 40 200", 71503)] [TestCase(null, 26499773)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; diff --git a/AdventOfCode/AOC.Tests/Y2023/Day07.cs b/AdventOfCode/AOC.Tests/Y2023/Day07.cs index 6aed71d..dfb5f60 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day07.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day07.cs @@ -20,7 +20,7 @@ KK677 28 KTJJT 220 QQQJA 483", 6440)] [TestCase(null, 247815719)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -86,7 +86,7 @@ AAAAA 61 2JJJJ 53 JJJJ2 41", 6839)] [TestCase(null, 248747492)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; diff --git a/AdventOfCode/AOC.Tests/Y2023/Day08.cs b/AdventOfCode/AOC.Tests/Y2023/Day08.cs index e6ac32c..4b7ed3f 100644 --- a/AdventOfCode/AOC.Tests/Y2023/Day08.cs +++ b/AdventOfCode/AOC.Tests/Y2023/Day08.cs @@ -29,7 +29,7 @@ AAA = (BBB, BBB) BBB = (AAA, ZZZ) ZZZ = (ZZZ, ZZZ)", 6)] [TestCase(null, 19199)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -89,7 +89,7 @@ ZZZ = (ZZZ, ZZZ)", 6)] 22Z = (22B, 22B) XXX = (XXX, XXX)", 6)] [TestCase(null, 1783)] // The actual answer - public async Task Part2(string input, int? expected) + public async Task Part2(string? input, int? expected) { string[] lines = input != null ? input.Split("\n") : realData; @@ -122,7 +122,7 @@ XXX = (XXX, XXX)", 6)] // For each location, follow the instruction for (int i = 0; i < currentLocations.Count; i++) { - int localI = i; // Local copy of the loop variable + int localI = i; // Local copy of the loop variable char instruction = instructions[instructionIndex]; tasks[localI] = Task.Factory.StartNew(() => { diff --git a/AdventOfCode/DayCreator/DayX.cs b/AdventOfCode/DayCreator/DayX.cs index b88f277..d0d32bc 100644 --- a/AdventOfCode/DayCreator/DayX.cs +++ b/AdventOfCode/DayCreator/DayX.cs @@ -16,7 +16,7 @@ public class DayX [TestCase("blah", 0)] [TestCase(null, 232)] // The actual answer - public void Part1(string input, int? expected) + public void Part1(string? input, int? expected) { string[] lines = input != null ? new[] { input } : realData; // string[] lines = input != null ? input.Split("\n") : realData; @@ -31,7 +31,7 @@ public class DayX [TestCase("blah", 1)] [TestCase(null, 1783)] // The actual answer - public void Part2(string input, int? expected) + public void Part2(string? input, int? expected) { //string[] lines = input != null ? new[] { input } : realData; // string[] lines = input != null ? input.Split("\n") : realData;