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>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<LangVersion>10</LangVersion>
|
||||||
|
<ImplicitUsings>true</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
6
Day1.cs
6
Day1.cs
|
|
@ -1,10 +1,6 @@
|
||||||
#define Day1
|
#define Day1
|
||||||
#if Day1
|
#if Day1
|
||||||
using System;
|
var scans = File.ReadAllLines("day1/input").Select(int.Parse).ToList();
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
var scans = File.ReadAllText("day1/input").Split("\n", StringSplitOptions.RemoveEmptyEntries).Select(l => int.Parse(l)).ToList();
|
|
||||||
Console.WriteLine(Enumerable.Range(1, scans.Count - 1).Count(i => scans[i - 1] < scans[i]));
|
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]));
|
Console.WriteLine(Enumerable.Range(3, scans.Count - 3).Count(i => scans[i - 3] < scans[i]));
|
||||||
#endif
|
#endif
|
||||||
6
Day2.cs
6
Day2.cs
|
|
@ -1,8 +1,4 @@
|
||||||
// #define Day2
|
// #define Day2
|
||||||
#if Day2
|
#if Day2
|
||||||
using System;
|
var toBeDefined = File.ReadAllLines("day2/input");
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
var toBeDefined = File.ReadAllText("day2/input").Split("\n", StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
#endif
|
#endif
|
||||||
Loading…
Reference in New Issue