feat: initial project setup for day 3
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<NoWarn>CA1822</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="TUnit" Version="0.4.63" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MullItOver\MullItOver.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
namespace MullItOver.Tests;
|
||||||
|
|
||||||
|
public class PuzzleParserTests
|
||||||
|
{
|
||||||
|
private readonly PuzzleParser _parser = new();
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Parse_WhenInputIsEmpty_ReturnsEmptyList()
|
||||||
|
{
|
||||||
|
var result = _parser.Parse("");
|
||||||
|
|
||||||
|
await Assert.That(result).IsEquivalentTo(new List<Instruction>());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
@@ -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)
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -15,6 +15,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedNosedReports", "02\RedNo
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedNosedReports.Tests", "02\RedNosedReports.Tests\RedNosedReports.Tests.csproj", "{8275EA3C-B88A-4719-866C-A5B49BD6B74E}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedNosedReports.Tests", "02\RedNosedReports.Tests\RedNosedReports.Tests.csproj", "{8275EA3C-B88A-4719-866C-A5B49BD6B74E}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03", "03", "{D4B938F3-3B4A-4020-BDD5-6F1A55063F83}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
03\INPUT.txt = 03\INPUT.txt
|
||||||
|
03\PROBLEM.md = 03\PROBLEM.md
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MullItOver.Tests", "03\MullItOver.Tests\MullItOver.Tests.csproj", "{1705CBAF-D90F-4303-932B-3AA65AC7A06B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MullItOver", "03\MullItOver\MullItOver.csproj", "{B0F3B761-E902-4853-85D0-E4DACABBBD2B}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -40,11 +50,21 @@ Global
|
|||||||
{8275EA3C-B88A-4719-866C-A5B49BD6B74E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8275EA3C-B88A-4719-866C-A5B49BD6B74E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{8275EA3C-B88A-4719-866C-A5B49BD6B74E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{8275EA3C-B88A-4719-866C-A5B49BD6B74E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{8275EA3C-B88A-4719-866C-A5B49BD6B74E}.Release|Any CPU.Build.0 = Release|Any CPU
|
{8275EA3C-B88A-4719-866C-A5B49BD6B74E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{1705CBAF-D90F-4303-932B-3AA65AC7A06B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{1705CBAF-D90F-4303-932B-3AA65AC7A06B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{1705CBAF-D90F-4303-932B-3AA65AC7A06B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{1705CBAF-D90F-4303-932B-3AA65AC7A06B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B0F3B761-E902-4853-85D0-E4DACABBBD2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B0F3B761-E902-4853-85D0-E4DACABBBD2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B0F3B761-E902-4853-85D0-E4DACABBBD2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B0F3B761-E902-4853-85D0-E4DACABBBD2B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{1AFE2FF1-A55D-4D86-A9BB-9875CA0D14D8} = {270B7829-6D23-4B34-91FE-D87D533AF2AB}
|
{1AFE2FF1-A55D-4D86-A9BB-9875CA0D14D8} = {270B7829-6D23-4B34-91FE-D87D533AF2AB}
|
||||||
{60DB12DB-3F63-4D9E-BA5A-ACEE0C9E1D05} = {270B7829-6D23-4B34-91FE-D87D533AF2AB}
|
{60DB12DB-3F63-4D9E-BA5A-ACEE0C9E1D05} = {270B7829-6D23-4B34-91FE-D87D533AF2AB}
|
||||||
{C2904CE1-B31B-47E4-B1A3-E2EC30731179} = {F73AFAD4-FBCE-4A39-B69E-CDA1B3921902}
|
{C2904CE1-B31B-47E4-B1A3-E2EC30731179} = {F73AFAD4-FBCE-4A39-B69E-CDA1B3921902}
|
||||||
{8275EA3C-B88A-4719-866C-A5B49BD6B74E} = {F73AFAD4-FBCE-4A39-B69E-CDA1B3921902}
|
{8275EA3C-B88A-4719-866C-A5B49BD6B74E} = {F73AFAD4-FBCE-4A39-B69E-CDA1B3921902}
|
||||||
|
{1705CBAF-D90F-4303-932B-3AA65AC7A06B} = {D4B938F3-3B4A-4020-BDD5-6F1A55063F83}
|
||||||
|
{B0F3B761-E902-4853-85D0-E4DACABBBD2B} = {D4B938F3-3B4A-4020-BDD5-6F1A55063F83}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
Reference in New Issue
Block a user