feat: setup for day 5

This commit is contained in:
Stevan Freeborn
2024-12-05 14:18:29 -06:00
parent 9e44721fb7
commit 61d67bfae1
14 changed files with 140 additions and 15 deletions
+2 -4
View File
@@ -3,6 +3,8 @@ root = true
# All files # All files
[*] [*]
indent_style = space indent_style = space
indent_size = 2
tab_width = 2
# Xml files # Xml files
[*.xml] [*.xml]
@@ -13,10 +15,6 @@ indent_size = 2
#### Core EditorConfig Options #### #### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 2
tab_width = 2
# New line preferences # New line preferences
insert_final_newline = false insert_final_newline = false
+3 -1
View File
@@ -406,7 +406,9 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
.idea/ .idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf/
## ##
## Visual studio for Mac ## Visual studio for Mac
+13
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
AdventOfCode2024
+4
View File
@@ -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
View File
@@ -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
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+1 -1
View File
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
@@ -17,4 +16,5 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
</Project> </Project>
+2 -4
View File
@@ -1,6 +1,4 @@
using System.Xml; namespace CeresSearch;
namespace CeresSearch;
record Direction(int XOffset, int YOffset) record Direction(int XOffset, int YOffset)
{ {
@@ -110,7 +108,7 @@ class Grid(string[] input)
return IsValidXmas(xmasMap); return IsValidXmas(xmasMap);
} }
private bool IsValidXmas(Dictionary<Direction, char> map) private static bool IsValidXmas(Dictionary<Direction, char> map)
{ {
var upToTheRight = map[Direction.UpToTheRight]; var upToTheRight = map[Direction.UpToTheRight];
var downToTheLeft = map[Direction.DownToTheLeft]; 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>
+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>
+26
View File
@@ -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)");
+19
View File
@@ -31,6 +31,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CeresSearch.Tests", "04\Cer
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CeresSearch", "04\CeresSearch\CeresSearch.csproj", "{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CeresSearch", "04\CeresSearch\CeresSearch.csproj", "{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}"
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB}.Release|Any CPU.Build.0 = 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 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}
@@ -82,5 +99,7 @@ Global
{B0F3B761-E902-4853-85D0-E4DACABBBD2B} = {D4B938F3-3B4A-4020-BDD5-6F1A55063F83} {B0F3B761-E902-4853-85D0-E4DACABBBD2B} = {D4B938F3-3B4A-4020-BDD5-6F1A55063F83}
{72B647D7-6F26-4661-BF59-2687233B9976} = {90547399-676A-4C0E-8CC1-75B7055DE486} {72B647D7-6F26-4661-BF59-2687233B9976} = {90547399-676A-4C0E-8CC1-75B7055DE486}
{3CC6D885-66BC-4F8B-89BF-C299D31AE9FB} = {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 EndGlobalSection
EndGlobal EndGlobal
+1 -1
View File
@@ -43,7 +43,7 @@ dotnet build
## Challenges ## Challenges
| Day | Problem | Solution | Notes | | Day | Problem | Solution | Notes |
|-----|----------------------------|:-----------------------------------:|----------------------------------------------------------------------------------------------| |-----|----------------------------|-------------------------------------|----------------------------------------------------------------------------------------------|
| 01 | [Problem](./01/PROBLEM.md) | [Solution](./01/HistorianHysteria/) | A great way to start! | | 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 | | 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. | | 03 | [Problem](./03/PROBLEM.md) | [Solution](./03/MullItOver/) | Thank goodness this wasn't a repeat of day 2. |