Code formatting and warning fixing.
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>AdventOfCode2017</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>AdventOfCode2017</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="inputs\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="inputs\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode.Common\AdventOfCode.Common.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode.Common\AdventOfCode.Common.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -48,10 +48,10 @@ public class Day01 : IDay
|
||||
{
|
||||
string input = inputs[0];
|
||||
int value = 0;
|
||||
for(int i = 0; i < input.Length; i++)
|
||||
for (int i = 0; i < input.Length; i++)
|
||||
{
|
||||
int nextI = (i + 1) % input.Length;
|
||||
if(input[i] == input[nextI])
|
||||
if (input[i] == input[nextI])
|
||||
{
|
||||
value += (input[i] - '0');
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ public class Day02 : IDay
|
||||
public string ResolvePart1(string[] inputs)
|
||||
{
|
||||
int checksum = 0;
|
||||
foreach(string input in inputs)
|
||||
foreach (string input in inputs)
|
||||
{
|
||||
int[] row = input
|
||||
.Split(new[] { " ", " " }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Split([" ", " "], StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(cell => Convert.ToInt32(cell))
|
||||
.ToArray();
|
||||
int max = row.Max();
|
||||
@@ -70,7 +70,7 @@ public class Day02 : IDay
|
||||
foreach (string input in inputs)
|
||||
{
|
||||
int[] row = input
|
||||
.Split(new[] { " ", " " }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Split([" ", " "], StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(cell => Convert.ToInt32(cell))
|
||||
.ToArray();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user