Create AdventOfCode.Common.

This commit is contained in:
2023-12-03 02:44:22 +01:00
parent b42aaa09c0
commit fd09931145
15 changed files with 54 additions and 161 deletions

View File

@@ -11,4 +11,8 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdventOfCode.Common\AdventOfCode.Common.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,7 +0,0 @@
namespace AdventOfCode2017;
public interface IDay
{
string ResolvePart1(string[] inputs);
string ResolvePart2(string[] inputs);
}

View File

@@ -1,28 +1,3 @@
using System;
using System.IO;
global using AdventOfCode.Common;
namespace AdventOfCode2017;
public class Program
{
private static void Main()
{
int currentDayNumber = 3;
IDay currentDay = null;
switch (currentDayNumber)
{
case 1: currentDay = new Day01(); break;
case 2: currentDay = new Day02(); break;
case 3: currentDay = new Day03(); break;
}
string[] linesDay = File.ReadAllLines($"inputs/Day{currentDayNumber:00}.txt");
string resultPart1 = currentDay.ResolvePart1(linesDay);
Console.WriteLine("Day{1:00} Result Part1: {0}", resultPart1, currentDayNumber);
string resultPart2 = currentDay.ResolvePart2(linesDay);
Console.WriteLine("Day{1:00} Result Part2: {0}", resultPart2, currentDayNumber);
Console.Read();
}
}
DayHelper.RunDay("AdventOfCode2017", 2);