Files
advent-of-code-2024/16/ReindeerMaze/Program.cs
T

26 lines
597 B
C#
Raw Normal View History

2024-12-16 09:24:23 -06:00
using System.Diagnostics;
2024-12-17 22:58:51 -06:00
using ReindeerMaze;
2024-12-17 17:23:12 -06:00
if (args.Length is 0)
{
Console.WriteLine("Please provide a path to the input file.");
return;
}
if (File.Exists(args[0]) is false)
{
Console.WriteLine("The provided file does not exist.");
return;
}
2024-12-16 09:24:23 -06:00
var isPart2 = args.Length is 2 && args[1] is "part2";
2024-12-17 17:23:12 -06:00
var input = await File.ReadAllLinesAsync(args[0]);
2024-12-16 09:24:23 -06:00
var stopwatch = new Stopwatch();
stopwatch.Start();
2024-12-17 22:58:51 -06:00
var result = PuzzleSolver.Solve(input, isPart2);
2024-12-16 09:24:23 -06:00
stopwatch.Stop();
2024-12-17 22:58:51 -06:00
Console.WriteLine($"The lowest score a Reindeer could get is {result}. ({stopwatch.ElapsedMilliseconds}ms)");