Started day 11 with template and pseudo code
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1f94ff2ca9
commit
9d39c61213
71
AdventOfCode/_2023/Day11.cs
Normal file
71
AdventOfCode/_2023/Day11.cs
Normal file
@ -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<string> 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<string, long> DistanceLookup { get; set; }
|
||||
public string Id { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
|
||||
public void CalculateDistance(IEnumerable<Galaxy> galaxies)
|
||||
{
|
||||
DistanceLookup = new Dictionary<string, long>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user