chore: setup for day 8
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
<Path>04/PROBLEM.md</Path>
|
<Path>04/PROBLEM.md</Path>
|
||||||
<Path>05/PROBLEM.md</Path>
|
<Path>05/PROBLEM.md</Path>
|
||||||
<Path>06</Path>
|
<Path>06</Path>
|
||||||
|
<Path>08</Path>
|
||||||
<Path>README.md</Path>
|
<Path>README.md</Path>
|
||||||
</explicitIncludes>
|
</explicitIncludes>
|
||||||
<explicitExcludes />
|
<explicitExcludes />
|
||||||
|
|||||||
@@ -19,12 +19,6 @@ class Map
|
|||||||
_input = input;
|
_input = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This can be optimized I think.
|
|
||||||
// Right now I'm basically doing a flood fill...I think
|
|
||||||
// I'm finding all the places on the map where I can
|
|
||||||
// place the obstruction, placing, and then seeing if
|
|
||||||
// a loop is created when guard patrols map.
|
|
||||||
// IDEA: Only check places on the guard's path
|
|
||||||
public int IdentifyNumberOfPlacementsForNewObstruction()
|
public int IdentifyNumberOfPlacementsForNewObstruction()
|
||||||
{
|
{
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
<ProjectReference Include="..\ResonantCollinearity\ResonantCollinearity.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="TUnit" Version="0.4.86" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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.ReadAllLinesAsync(args[0]);
|
||||||
|
|
||||||
|
var stopwatch = new Stopwatch();
|
||||||
|
stopwatch.Start();
|
||||||
|
|
||||||
|
// TODO: Implement solution
|
||||||
|
|
||||||
|
stopwatch.Stop();
|
||||||
|
Console.WriteLine($". ({stopwatch.ElapsedMilliseconds}ms)");
|
||||||
@@ -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>
|
||||||
@@ -60,6 +60,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BridgeRepair", "07\BridgeRe
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BridgeRepair.Tests", "07\BridgeRepair.Tests\BridgeRepair.Tests.csproj", "{23C9756E-F2F4-44CA-B38A-DB92782D7858}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BridgeRepair.Tests", "07\BridgeRepair.Tests\BridgeRepair.Tests.csproj", "{23C9756E-F2F4-44CA-B38A-DB92782D7858}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "08", "08", "{F2A51E88-BCCC-4778-9369-63E72D052554}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResonantCollinearity", "08\ResonantCollinearity\ResonantCollinearity.csproj", "{425DF10B-4621-4882-935A-0320F1C4B6DD}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResonantCollinearity.Tests", "08\ResonantCollinearity.Tests\ResonantCollinearity.Tests.csproj", "{4741807B-CD85-4A87-BE6E-DC506C4CD1E6}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -125,6 +131,14 @@ Global
|
|||||||
{23C9756E-F2F4-44CA-B38A-DB92782D7858}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{23C9756E-F2F4-44CA-B38A-DB92782D7858}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{23C9756E-F2F4-44CA-B38A-DB92782D7858}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{23C9756E-F2F4-44CA-B38A-DB92782D7858}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{23C9756E-F2F4-44CA-B38A-DB92782D7858}.Release|Any CPU.Build.0 = Release|Any CPU
|
{23C9756E-F2F4-44CA-B38A-DB92782D7858}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{425DF10B-4621-4882-935A-0320F1C4B6DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{425DF10B-4621-4882-935A-0320F1C4B6DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{425DF10B-4621-4882-935A-0320F1C4B6DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{425DF10B-4621-4882-935A-0320F1C4B6DD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4741807B-CD85-4A87-BE6E-DC506C4CD1E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4741807B-CD85-4A87-BE6E-DC506C4CD1E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4741807B-CD85-4A87-BE6E-DC506C4CD1E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4741807B-CD85-4A87-BE6E-DC506C4CD1E6}.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}
|
||||||
@@ -141,5 +155,7 @@ Global
|
|||||||
{F76B41EB-C479-437E-A98B-137A237E2B71} = {293B49F7-594F-4F27-B018-A732820FB797}
|
{F76B41EB-C479-437E-A98B-137A237E2B71} = {293B49F7-594F-4F27-B018-A732820FB797}
|
||||||
{C9D192EE-0384-4875-BB32-54F7168D6C3C} = {73EE2FA2-6417-4518-9790-72D4F2B62CAF}
|
{C9D192EE-0384-4875-BB32-54F7168D6C3C} = {73EE2FA2-6417-4518-9790-72D4F2B62CAF}
|
||||||
{23C9756E-F2F4-44CA-B38A-DB92782D7858} = {73EE2FA2-6417-4518-9790-72D4F2B62CAF}
|
{23C9756E-F2F4-44CA-B38A-DB92782D7858} = {73EE2FA2-6417-4518-9790-72D4F2B62CAF}
|
||||||
|
{425DF10B-4621-4882-935A-0320F1C4B6DD} = {F2A51E88-BCCC-4778-9369-63E72D052554}
|
||||||
|
{4741807B-CD85-4A87-BE6E-DC506C4CD1E6} = {F2A51E88-BCCC-4778-9369-63E72D052554}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
Reference in New Issue
Block a user