feat: initial project setup for day 3

This commit is contained in:
Stevan Freeborn
2024-12-03 22:25:18 -06:00
parent 597e08024f
commit 0a7b6b2291
5 changed files with 112 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>CA1822</NoWarn>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
</ItemGroup>
<ItemGroup>
<Content Include="..\INPUT.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
+38
View File
@@ -0,0 +1,38 @@
using System.Diagnostics;
if (args.Length is 0)
{
Console.WriteLine("Please provide a path to the input file.");
return;
}
if (File.Exists(args[0]) is false)
{
Console.WriteLine("The provided file does not exist.");
return;
}
var isPart2 = args.Length is 2 && args[1] is "part2";
var input = await File.ReadAllTextAsync(args[0]);
var stopwatch = new Stopwatch();
stopwatch.Start();
var instructions = new PuzzleParser().Parse(input);
var results = 0;
stopwatch.Stop();
Console.WriteLine($"The sum of instructions is {results}. ({stopwatch.ElapsedMilliseconds}ms)");
class PuzzleParser
{
public List<Instruction> Parse(string input)
{
return [];
}
}
class Instruction(int multiplicandOne, int multiplicandTwo)
{
}