Parcourir la source

Scaffold for Day 21

Lukas Angerer il y a 2 ans
Parent
commit
c56d356839
5 fichiers modifiés avec 55 ajouts et 0 suppressions
  1. 6 0
      AdventOfCode23.sln
  2. 10 0
      Day21/Day21.csproj
  3. 19 0
      Day21/Parser.cs
  4. 20 0
      Day21/Program.cs
  5. 0 0
      Day21/inputs/sample1.txt

+ 6 - 0
AdventOfCode23.sln

@@ -43,6 +43,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Day19", "Day19\Day19.csproj
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Day20", "Day20\Day20.csproj", "{6C82E968-F49F-4E6D-92B3-84074C9E765D}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Day21", "Day21\Day21.csproj", "{CB4C7EDE-A695-4B3B-A690-E45B6C673AD1}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -132,5 +134,9 @@ Global
 		{6C82E968-F49F-4E6D-92B3-84074C9E765D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{6C82E968-F49F-4E6D-92B3-84074C9E765D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{6C82E968-F49F-4E6D-92B3-84074C9E765D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CB4C7EDE-A695-4B3B-A690-E45B6C673AD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CB4C7EDE-A695-4B3B-A690-E45B6C673AD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CB4C7EDE-A695-4B3B-A690-E45B6C673AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CB4C7EDE-A695-4B3B-A690-E45B6C673AD1}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 EndGlobal

+ 10 - 0
Day21/Day21.csproj

@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+</Project>

+ 19 - 0
Day21/Parser.cs

@@ -0,0 +1,19 @@
+using System.Text.RegularExpressions;
+
+namespace Day21;
+
+public partial class Parser
+{
+    [GeneratedRegex(@".*")]
+    private partial Regex LineMatch();
+    
+    public void Parse(string inputFile)
+    {
+        using var reader = File.OpenText(inputFile);
+        
+        while (!reader.EndOfStream)
+        {
+            var line = reader.ReadLine()!;
+        }
+    }
+}

+ 20 - 0
Day21/Program.cs

@@ -0,0 +1,20 @@
+using System.Diagnostics;
+
+using Day21;
+
+if (args.Any(a => a == "--debug"))
+{
+    Console.WriteLine("DEBUG");
+    Console.WriteLine(Debugger.Launch());
+}
+
+if (args.Length < 1)
+{
+    Console.WriteLine("Requires 1 args: inputFileName");
+    return -1;
+}
+
+var inputFile = args[0];
+var parser = new Parser();
+
+return 0;

+ 0 - 0
Day21/inputs/sample1.txt