feat: setup for day 5
This commit is contained in:
+2
-4
@@ -3,6 +3,8 @@ root = true
|
||||
# All files
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
|
||||
# Xml files
|
||||
[*.xml]
|
||||
@@ -13,10 +15,6 @@ indent_size = 2
|
||||
|
||||
#### Core EditorConfig Options ####
|
||||
|
||||
# Indentation and spacing
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
|
||||
# New line preferences
|
||||
insert_final_newline = false
|
||||
|
||||
|
||||
+3
-1
@@ -406,7 +406,9 @@ FodyWeavers.xsd
|
||||
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
.idea/
|
||||
.idea/workspace.xml
|
||||
.idea/usage.statistics.xml
|
||||
.idea/shelf/
|
||||
|
||||
##
|
||||
## Visual studio for Mac
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/modules.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/contentModel.xml
|
||||
/.idea.AdventOfCode2024.iml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+1
@@ -0,0 +1 @@
|
||||
AdventOfCode2024
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes>
|
||||
<Path>.gitignore</Path>
|
||||
<Path>01/INPUT.txt</Path>
|
||||
<Path>01/PROBLEM.md</Path>
|
||||
<Path>02/INPUT.txt</Path>
|
||||
<Path>02/PROBLEM.md</Path>
|
||||
<Path>04/INPUT.txt</Path>
|
||||
<Path>04/PROBLEM.md</Path>
|
||||
<Path>05/PROBLEM.md</Path>
|
||||
<Path>README.md</Path>
|
||||
</explicitIncludes>
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
@@ -17,4 +16,5 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Xml;
|
||||
|
||||
namespace CeresSearch;
|
||||
namespace CeresSearch;
|
||||
|
||||
record Direction(int XOffset, int YOffset)
|
||||
{
|
||||
@@ -110,7 +108,7 @@ class Grid(string[] input)
|
||||
return IsValidXmas(xmasMap);
|
||||
}
|
||||
|
||||
private bool IsValidXmas(Dictionary<Direction, char> map)
|
||||
private static bool IsValidXmas(Dictionary<Direction, char> map)
|
||||
{
|
||||
var upToTheRight = map[Direction.UpToTheRight];
|
||||
var downToTheLeft = map[Direction.DownToTheLeft];
|
||||
|
||||
@@ -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="..\PrintQueue\PrintQueue.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="TUnit" Version="0.4.74" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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,26 @@
|
||||
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: Perform work here
|
||||
|
||||
stopwatch.Stop();
|
||||
|
||||
// TODO: Print results
|
||||
Console.WriteLine($". ({stopwatch.ElapsedMilliseconds}ms)");
|
||||
@@ -31,6 +31,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CeresSearch.Tests", "04\Cer
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CeresSearch", "04\CeresSearch\CeresSearch.csproj", "{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05", "05", "{7253666E-E9DA-4F2E-9A19-8C40D96CC7C1}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
05\INPUT.txt = 05\INPUT.txt
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrintQueue", "05\PrintQueue\PrintQueue.csproj", "{DAF18CE4-2203-407C-BACD-8401BECD74AB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrintQueue.Tests", "05\PrintQueue.Tests\PrintQueue.Tests.csproj", "{4563BCC8-A1E6-448C-BF2D-D0A3E85B9654}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -72,6 +81,14 @@ Global
|
||||
{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DAF18CE4-2203-407C-BACD-8401BECD74AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DAF18CE4-2203-407C-BACD-8401BECD74AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DAF18CE4-2203-407C-BACD-8401BECD74AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DAF18CE4-2203-407C-BACD-8401BECD74AB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4563BCC8-A1E6-448C-BF2D-D0A3E85B9654}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4563BCC8-A1E6-448C-BF2D-D0A3E85B9654}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4563BCC8-A1E6-448C-BF2D-D0A3E85B9654}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4563BCC8-A1E6-448C-BF2D-D0A3E85B9654}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{1AFE2FF1-A55D-4D86-A9BB-9875CA0D14D8} = {270B7829-6D23-4B34-91FE-D87D533AF2AB}
|
||||
@@ -82,5 +99,7 @@ Global
|
||||
{B0F3B761-E902-4853-85D0-E4DACABBBD2B} = {D4B938F3-3B4A-4020-BDD5-6F1A55063F83}
|
||||
{72B647D7-6F26-4661-BF59-2687233B9976} = {90547399-676A-4C0E-8CC1-75B7055DE486}
|
||||
{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB} = {90547399-676A-4C0E-8CC1-75B7055DE486}
|
||||
{DAF18CE4-2203-407C-BACD-8401BECD74AB} = {7253666E-E9DA-4F2E-9A19-8C40D96CC7C1}
|
||||
{4563BCC8-A1E6-448C-BF2D-D0A3E85B9654} = {7253666E-E9DA-4F2E-9A19-8C40D96CC7C1}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -43,7 +43,7 @@ dotnet build
|
||||
## Challenges
|
||||
|
||||
| Day | Problem | Solution | Notes |
|
||||
|-----|----------------------------|:-----------------------------------:|----------------------------------------------------------------------------------------------|
|
||||
|-----|----------------------------|-------------------------------------|----------------------------------------------------------------------------------------------|
|
||||
| 01 | [Problem](./01/PROBLEM.md) | [Solution](./01/HistorianHysteria/) | A great way to start! |
|
||||
| 02 | [Problem](./02/PROBLEM.md) | [Solution](./02/RedNosedReports/) | Damn their was an edge case that really bit me...direction change after first pair of levels |
|
||||
| 03 | [Problem](./03/PROBLEM.md) | [Solution](./03/MullItOver/) | Thank goodness this wasn't a repeat of day 2. |
|
||||
|
||||
Reference in New Issue
Block a user