38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace AoC_2021
|
|
{
|
|
internal static class Program
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
Console.WriteLine($"Starting");
|
|
var watch = System.Diagnostics.Stopwatch.StartNew();
|
|
|
|
Days.Day1();
|
|
|
|
watch.Stop();
|
|
Console.WriteLine($"Running time: {watch.ElapsedMilliseconds}ms");
|
|
Console.ReadKey();
|
|
}
|
|
}
|
|
|
|
internal static class Util
|
|
{
|
|
private static string GetProjectDataPath()
|
|
{
|
|
string workingDirectory = Environment.CurrentDirectory;
|
|
string? projectDirectory = Directory.GetParent(workingDirectory)?.Parent?.Parent?.FullName;
|
|
Debug.Assert(projectDirectory != null, nameof(projectDirectory) + " != null");
|
|
return Path.Combine(projectDirectory, @"data\");
|
|
}
|
|
|
|
public static string[] GetStringData(string taskFileDataName)
|
|
{
|
|
string path = Path.Combine(GetProjectDataPath(), taskFileDataName);
|
|
Console.WriteLine($"Getting data from: {path}");
|
|
return File.ReadAllLines(path);
|
|
}
|
|
}
|
|
} |