diff --git a/AoC2021.csproj b/AoC2021.csproj index 9590466..e78d5e5 100644 --- a/AoC2021.csproj +++ b/AoC2021.csproj @@ -2,7 +2,10 @@ Exe - net5.0 + net6.0 + 10 + true + enable diff --git a/Day1.cs b/Day1.cs index 2551062..2303011 100644 --- a/Day1.cs +++ b/Day1.cs @@ -1,10 +1,6 @@ #define Day1 #if Day1 -using System; -using System.IO; -using System.Linq; - -var scans = File.ReadAllText("day1/input").Split("\n", StringSplitOptions.RemoveEmptyEntries).Select(l => int.Parse(l)).ToList(); +var scans = File.ReadAllLines("day1/input").Select(int.Parse).ToList(); Console.WriteLine(Enumerable.Range(1, scans.Count - 1).Count(i => scans[i - 1] < scans[i])); Console.WriteLine(Enumerable.Range(3, scans.Count - 3).Count(i => scans[i - 3] < scans[i])); #endif \ No newline at end of file diff --git a/Day2.cs b/Day2.cs index 3c18660..0ea7991 100644 --- a/Day2.cs +++ b/Day2.cs @@ -1,8 +1,4 @@ // #define Day2 #if Day2 -using System; -using System.IO; -using System.Linq; - -var toBeDefined = File.ReadAllText("day2/input").Split("\n", StringSplitOptions.RemoveEmptyEntries); +var toBeDefined = File.ReadAllLines("day2/input"); #endif \ No newline at end of file diff --git a/README.md b/README.md index ce3a07f..af0d725 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Before moving to the next file, comment out the first line again, as only one fi ### Requirements -C# 9.0 and .NET 5 +C# 10.0 and .NET 6 ### Execute