-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (26 loc) · 969 Bytes
/
Copy pathProgram.cs
File metadata and controls
30 lines (26 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using static System.Net.Mime.MediaTypeNames;
namespace AdventOfCode
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the year you are solving");
var year = Console.ReadLine();
Console.WriteLine("Enter the day you are solving");
var dayNo = Console.ReadLine();
Console.WriteLine("You are solving puzzles from day " + dayNo + ", " + year + ".");
IPuzzle puzzle;
var dayPuzzle = Type.GetType("AdventOfCode._" + year + ".Day" + dayNo.PadLeft(2,'0'));
if (dayPuzzle != null)
{
puzzle = Activator.CreateInstance(dayPuzzle) as IPuzzle;
}
else
{
Console.WriteLine("No puzzle solution has been created for day " + dayNo + ", " + year + ".");
Console.ReadLine();
}
}
}
}