Lukas Angerer 2 жил өмнө
parent
commit
5988979681

+ 6 - 0
AdventOfCode23.sln

@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Day7", "Day7\Day7.csproj",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Day8", "Day8\Day8.csproj", "{9FD0976B-C003-485C-914E-A04ABB76B605}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Day9", "Day9\Day9.csproj", "{A29D3860-4D55-4731-85D5-9D4B4C09E847}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -60,5 +62,9 @@ Global
 		{9FD0976B-C003-485C-914E-A04ABB76B605}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{9FD0976B-C003-485C-914E-A04ABB76B605}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{9FD0976B-C003-485C-914E-A04ABB76B605}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A29D3860-4D55-4731-85D5-9D4B4C09E847}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A29D3860-4D55-4731-85D5-9D4B4C09E847}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A29D3860-4D55-4731-85D5-9D4B4C09E847}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A29D3860-4D55-4731-85D5-9D4B4C09E847}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 EndGlobal

+ 10 - 0
Day9/Day9.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
Day9/Parser.cs

@@ -0,0 +1,19 @@
+using System.Text.RegularExpressions;
+
+namespace Day9;
+
+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
Day9/Program.cs

@@ -0,0 +1,20 @@
+using System.Diagnostics;
+
+using Day9;
+
+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
Day9/inputs/sample1.txt