diff --git a/.idea/.idea.AdventOfCode2024/.idea/indexLayout.xml b/.idea/.idea.AdventOfCode2024/.idea/indexLayout.xml index 81379ac..d1c08f7 100644 --- a/.idea/.idea.AdventOfCode2024/.idea/indexLayout.xml +++ b/.idea/.idea.AdventOfCode2024/.idea/indexLayout.xml @@ -12,6 +12,7 @@ 04/PROBLEM.md 05/PROBLEM.md 06 + 08 README.md diff --git a/06/GuardGallivant/Map.cs b/06/GuardGallivant/Map.cs index 2529d0e..747280a 100644 --- a/06/GuardGallivant/Map.cs +++ b/06/GuardGallivant/Map.cs @@ -19,12 +19,6 @@ class Map _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() { var count = 0; diff --git a/08/ResonantCollinearity.Tests/ResonantCollinearity.Tests.csproj b/08/ResonantCollinearity.Tests/ResonantCollinearity.Tests.csproj new file mode 100644 index 0000000..2aee005 --- /dev/null +++ b/08/ResonantCollinearity.Tests/ResonantCollinearity.Tests.csproj @@ -0,0 +1,19 @@ + + + + Exe + net9.0 + enable + enable + CA1822 + + + + + + + + + + + diff --git a/08/ResonantCollinearity/Program.cs b/08/ResonantCollinearity/Program.cs new file mode 100644 index 0000000..5f94bf8 --- /dev/null +++ b/08/ResonantCollinearity/Program.cs @@ -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)"); \ No newline at end of file diff --git a/08/ResonantCollinearity/ResonantCollinearity.csproj b/08/ResonantCollinearity/ResonantCollinearity.csproj new file mode 100644 index 0000000..ade7612 --- /dev/null +++ b/08/ResonantCollinearity/ResonantCollinearity.csproj @@ -0,0 +1,21 @@ + + + + Exe + net9.0 + enable + enable + CA1822 + + + + + + + + + PreserveNewest + + + + diff --git a/AdventOfCode2024.sln b/AdventOfCode2024.sln index 5d8452f..b128eeb 100644 --- a/AdventOfCode2024.sln +++ b/AdventOfCode2024.sln @@ -60,6 +60,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BridgeRepair", "07\BridgeRe EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BridgeRepair.Tests", "07\BridgeRepair.Tests\BridgeRepair.Tests.csproj", "{23C9756E-F2F4-44CA-B38A-DB92782D7858}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(NestedProjects) = preSolution {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} {C9D192EE-0384-4875-BB32-54F7168D6C3C} = {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 EndGlobal