Initial commit
This commit is contained in:
23
AdventOfCode/AdventOfCode.csproj
Normal file
23
AdventOfCode/AdventOfCode.csproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AoCHelper" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<NoWarn>S101</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Inputs\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
15
AdventOfCode/Day01.cs
Normal file
15
AdventOfCode/Day01.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace AdventOfCode;
|
||||
|
||||
public class Day01 : BaseDay
|
||||
{
|
||||
private readonly string _input;
|
||||
|
||||
public Day01()
|
||||
{
|
||||
_input = File.ReadAllText(InputFilePath);
|
||||
}
|
||||
|
||||
public override ValueTask<string> Solve_1() => new($"Solution to {ClassPrefix} {CalculateIndex()}, part 1");
|
||||
|
||||
public override ValueTask<string> Solve_2() => new($"Solution to {ClassPrefix} {CalculateIndex()}, part 2");
|
||||
}
|
15
AdventOfCode/Day_26.cs
Normal file
15
AdventOfCode/Day_26.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace AdventOfCode;
|
||||
|
||||
public class Day_26 : BaseDay
|
||||
{
|
||||
private readonly string _input;
|
||||
|
||||
public Day_26()
|
||||
{
|
||||
_input = File.ReadAllText(InputFilePath);
|
||||
}
|
||||
|
||||
public override ValueTask<string> Solve_1() => new(_input.Length.ToString());
|
||||
|
||||
public override ValueTask<string> Solve_2() => throw new NotImplementedException();
|
||||
}
|
1
AdventOfCode/GlobalUsings.cs
Normal file
1
AdventOfCode/GlobalUsings.cs
Normal file
@@ -0,0 +1 @@
|
||||
global using AoCHelper;
|
1
AdventOfCode/Inputs/01.txt
Normal file
1
AdventOfCode/Inputs/01.txt
Normal file
@@ -0,0 +1 @@
|
||||
<Day 1 file input content>
|
1
AdventOfCode/Inputs/26.txt
Normal file
1
AdventOfCode/Inputs/26.txt
Normal file
@@ -0,0 +1 @@
|
||||
<Day 26 file input content>
|
18
AdventOfCode/Program.cs
Normal file
18
AdventOfCode/Program.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
if (args.Length == 0)
|
||||
{
|
||||
await Solver.SolveLast(opt => opt.ClearConsole = false);
|
||||
}
|
||||
else if (args.Length == 1 && args[0].Contains("all", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
await Solver.SolveAll(opt =>
|
||||
{
|
||||
opt.ShowConstructorElapsedTime = true;
|
||||
opt.ShowTotalElapsedTimePerDay = true;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var indexes = args.Select(arg => uint.TryParse(arg, out var index) ? index : uint.MaxValue);
|
||||
|
||||
await Solver.Solve(indexes.Where(i => i < uint.MaxValue));
|
||||
}
|
Reference in New Issue
Block a user