Update to .NET 6 and C# 6 for `implicit using directives`
This commit is contained in:
parent
98fe28cb59
commit
96fe2d121d
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
6
Day1.cs
6
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
|
||||
6
Day2.cs
6
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
|
||||
Loading…
Reference in New Issue