diff --git a/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj b/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj
index 8afe983..27be6ca 100644
--- a/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj
+++ b/AdventOfCode2018.Tests/AdventOfCode2018.Tests.csproj
@@ -62,6 +62,7 @@
+
diff --git a/AdventOfCode2018.Tests/Day06_Tests.cs b/AdventOfCode2018.Tests/Day06_Tests.cs
new file mode 100644
index 0000000..14c558b
--- /dev/null
+++ b/AdventOfCode2018.Tests/Day06_Tests.cs
@@ -0,0 +1,25 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace AdventOfCode2018.Tests
+{
+ [TestClass()]
+ public class Day06_Tests
+ {
+ [TestMethod()]
+ public void ResolvePart1__Test()
+ {
+ Day06 day06 = new Day06();
+
+ string result = day06.ResolvePart1(new string[] {
+ "1, 1",
+ "1, 6",
+ "8, 3",
+ "3, 4",
+ "5, 5",
+ "8, 9",
+ });
+
+ Assert.AreEqual("17", result);
+ }
+ }
+}
\ No newline at end of file
diff --git a/AdventOfCode2018/AdventOfCode2018.csproj b/AdventOfCode2018/AdventOfCode2018.csproj
index 297a60f..946ae4e 100644
--- a/AdventOfCode2018/AdventOfCode2018.csproj
+++ b/AdventOfCode2018/AdventOfCode2018.csproj
@@ -48,6 +48,7 @@
+
@@ -67,6 +68,9 @@
PreserveNewest
+
+ PreserveNewest
+
\ No newline at end of file
diff --git a/AdventOfCode2018/Day06.cs b/AdventOfCode2018/Day06.cs
new file mode 100644
index 0000000..ffacc84
--- /dev/null
+++ b/AdventOfCode2018/Day06.cs
@@ -0,0 +1,70 @@
+namespace AdventOfCode2018
+{
+ /*
+ --- Day 6: Chronal Coordinates ---
+
+ The device on your wrist beeps several times, and once again you feel like you're falling.
+
+ "Situation critical," the device announces. "Destination indeterminate. Chronal interference detected. Please specify new target coordinates."
+
+ The device then produces a list of coordinates (your puzzle input). Are they places it thinks are safe or dangerous? It recommends you check manual page 729. The Elves did not give you a manual.
+
+ If they're dangerous, maybe you can minimize the danger by finding the coordinate that gives the largest distance from the other points.
+
+ Using only the Manhattan distance, determine the area around each coordinate by counting the number of integer X,Y locations that are closest to that coordinate (and aren't tied in distance to any other coordinate).
+
+ Your goal is to find the size of the largest area that isn't infinite. For example, consider the following list of coordinates:
+
+ 1, 1
+ 1, 6
+ 8, 3
+ 3, 4
+ 5, 5
+ 8, 9
+
+ If we name these coordinates A through F, we can draw them on a grid, putting 0,0 at the top left:
+
+ ..........
+ .A........
+ ..........
+ ........C.
+ ...D......
+ .....E....
+ .B........
+ ..........
+ ..........
+ ........F.
+
+ This view is partial - the actual grid extends infinitely in all directions. Using the Manhattan distance, each location's closest coordinate can be determined, shown here in lowercase:
+
+ aaaaa.cccc
+ aAaaa.cccc
+ aaaddecccc
+ aadddeccCc
+ ..dDdeeccc
+ bb.deEeecc
+ bBb.eeee..
+ bbb.eeefff
+ bbb.eeffff
+ bbb.ffffFf
+
+ Locations shown as . are equally far from two or more coordinates, and so they don't count as being closest to any.
+
+ In this example, the areas of coordinates A, B, C, and F are infinite - while not shown here, their areas extend forever outside the visible grid. However, the areas of coordinates D and E are finite: D is closest to 9 locations, and E is closest to 17 (both including the coordinate's location itself). Therefore, in this example, the size of the largest area is 17.
+
+ What is the size of the largest area that isn't infinite?
+
+ */
+ public class Day06
+ {
+ public string ResolvePart1(string[] inputs)
+ {
+ return null;
+ }
+
+ public string ResolvePart2(string[] inputs)
+ {
+ return null;
+ }
+ }
+}
diff --git a/AdventOfCode2018/Program.cs b/AdventOfCode2018/Program.cs
index 159a57e..d62e7c3 100644
--- a/AdventOfCode2018/Program.cs
+++ b/AdventOfCode2018/Program.cs
@@ -7,7 +7,7 @@ namespace AdventOfCode2018
{
private static void Main(string[] args)
{
- int currentDay = 5;
+ int currentDay = 6;
if (currentDay == 1)
{
@@ -64,6 +64,17 @@ namespace AdventOfCode2018
Console.WriteLine("Day04 Result Part2: {0}", resultPart2);
}
+ if (currentDay == 6)
+ {
+ // Resolve Day06
+ Day06 day06 = new Day06();
+ string[] linesDay06 = File.ReadAllLines("inputs/Day06.txt");
+ string resultPart1 = day06.ResolvePart1(linesDay06);
+ Console.WriteLine("Day06 Result Part1: {0}", resultPart1);
+ string resultPart2 = day06.ResolvePart2(linesDay06);
+ Console.WriteLine("Day06 Result Part2: {0}", resultPart2);
+ }
+
Console.Read();
}
}
diff --git a/AdventOfCode2018/inputs/Day06.txt b/AdventOfCode2018/inputs/Day06.txt
new file mode 100644
index 0000000..3fb536f
--- /dev/null
+++ b/AdventOfCode2018/inputs/Day06.txt
@@ -0,0 +1,50 @@
+315, 342
+59, 106
+44, 207
+52, 81
+139, 207
+93, 135
+152, 187
+271, 47
+223, 342
+50, 255
+332, 68
+322, 64
+250, 72
+165, 209
+129, 350
+139, 118
+282, 129
+311, 264
+216, 246
+134, 42
+66, 151
+263, 199
+222, 169
+236, 212
+320, 178
+202, 288
+273, 190
+83, 153
+88, 156
+284, 305
+131, 90
+152, 88
+358, 346
+272, 248
+317, 122
+166, 179
+301, 307
+156, 128
+261, 290
+268, 312
+89, 53
+324, 173
+353, 177
+91, 69
+303, 164
+40, 221
+146, 344
+61, 314
+319, 224
+98, 143