Project files and Day01.
This commit is contained in:
46
AdventOfCode2020/Program.cs
Normal file
46
AdventOfCode2020/Program.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace AdventOfCode2020
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int currentDayNumber = 1;
|
||||
IDay currentDay = null;
|
||||
|
||||
switch (currentDayNumber)
|
||||
{
|
||||
case 1: currentDay = new Day01(); break;
|
||||
}
|
||||
|
||||
Console.WriteLine(string.Format("Day {0:00}", currentDayNumber));
|
||||
Console.WriteLine("------");
|
||||
Console.WriteLine();
|
||||
string[] linesDay = File.ReadAllLines(string.Format("inputs/Day{0:00}.txt", currentDayNumber));
|
||||
try
|
||||
{
|
||||
string resultPart1 = currentDay.ResolvePart1(linesDay);
|
||||
Console.WriteLine("Day{1:00} Result Part1: {0}", resultPart1, currentDayNumber);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
Console.WriteLine(ex.StackTrace);
|
||||
}
|
||||
try
|
||||
{
|
||||
string resultPart2 = currentDay.ResolvePart2(linesDay);
|
||||
Console.WriteLine("Day{1:00} Result Part2: {0}", resultPart2, currentDayNumber);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
Console.WriteLine(ex.StackTrace);
|
||||
}
|
||||
|
||||
Console.Read();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user