From 6167f7953aa850b5be7b660c97f5656a7bd9ccca Mon Sep 17 00:00:00 2001 From: Amatsugu Date: Sun, 10 Dec 2023 11:06:05 -0500 Subject: [PATCH] day 10 start --- .../Problems/AOC2023/Day10/PipeMaze.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 AdventOfCode/Problems/AOC2023/Day10/PipeMaze.cs diff --git a/AdventOfCode/Problems/AOC2023/Day10/PipeMaze.cs b/AdventOfCode/Problems/AOC2023/Day10/PipeMaze.cs new file mode 100644 index 0000000..80b4d61 --- /dev/null +++ b/AdventOfCode/Problems/AOC2023/Day10/PipeMaze.cs @@ -0,0 +1,50 @@ +using AdventOfCode.Runner.Attributes; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AdventOfCode.Problems.AOC2023.Day10; + +[ProblemInfo(2023, 10, "Pipe Maze")] +internal class PipeMaze : Problem +{ + private string[] _maze = []; + + public override void LoadInput() + { + _maze = ReadInputLines(); + } + + public override void CalculatePart1() + { + throw new NotImplementedException(); + } + + private (int x, int y) GetNextPoint((int x, int y) pos, (int x, int y) prev) + { + var curPipe = _maze[pos.y][pos.x]; + if(curPipe == 'S') + { + throw new Exception(); + } + return curPipe switch + { + '|' => (pos.x, pos.y + (pos.y - prev.y)), + '-' => (pos.x + (pos.x - prev.x), pos.y), + 'L' => (0,0), + 'F' => (0,0), + 'J' => (0,0), + '7' => (0,0), + _ => throw new Exception() + }; + } + + public override void CalculatePart2() + { + throw new NotImplementedException(); + } + +}