From 9d39c61213ce7ef7333154d336f94c6f13569556 Mon Sep 17 00:00:00 2001 From: Xander Sigler Date: Sun, 10 Dec 2023 21:52:32 -0800 Subject: [PATCH] Started day 11 with template and pseudo code --- AdventOfCode/_2023/Day11.cs | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 AdventOfCode/_2023/Day11.cs diff --git a/AdventOfCode/_2023/Day11.cs b/AdventOfCode/_2023/Day11.cs new file mode 100644 index 0000000..fac36ac --- /dev/null +++ b/AdventOfCode/_2023/Day11.cs @@ -0,0 +1,71 @@ +using AdventOfCode.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace AdventOfCode._2023 +{ + public class Day11 : AOCDay + { + + protected override AOCResponse ExecutePartA() + { + + return this._response; + } + + protected override AOCResponse ExecutePartB() + { + + return this._response; + } + } + + class UniverseGalaxy + { + private string[,] _board; + public UniverseGalaxy(List input) + { + var rows = input.Count; + var columns = input.First().Length; + _board = new string[rows, columns]; + + for (int y = 0; y < rows; y++) + { + for (int x = 0; x < columns; x++) + { + _board[x, y] = input[x][y].ToString(); + } + } + + //TODO Double the board + + //TODO Find all the galaxies on the board + + //TODO Calculate the distance between all of the galaxies + + //TODO Find the shortest distance between them! + } + } + + class Galaxy + { + public Dictionary DistanceLookup { get; set; } + public string Id { get; set; } + public int X { get; set; } + public int Y { get; set; } + + public void CalculateDistance(IEnumerable galaxies) + { + DistanceLookup = new Dictionary(); + foreach (var galaxy in galaxies) + { + if (galaxy.Id.Equals(this.Id)) continue; + + long distanceBetweenGalaxies = -1; //TODO need to calculate this? some math.min and math.max + DistanceLookup[galaxy.Id] = distanceBetweenGalaxies; + } + } + } +}