You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
|
|
namespace AdventOfCode.Contracts
|
|
{
|
|
public abstract class Day
|
|
{
|
|
public abstract int Year { get; }
|
|
public abstract int DayNumber { get; }
|
|
|
|
private List<string> Output { get; set; } = new List<string>();
|
|
|
|
protected void Print(string part, object output) =>
|
|
Output.Add($"{Year} Day {DayNumber} Part {part}: {output}");
|
|
|
|
protected void Print(string part, long elapsed, object output) =>
|
|
Output.Add($"{Year} Day {DayNumber} Part {part}: {output} {Environment.NewLine}Time: {elapsed}");
|
|
|
|
public void Write() =>
|
|
Console.WriteLine(string.Join(Environment.NewLine, Output));
|
|
|
|
public void Execute(bool bigBoi)
|
|
{
|
|
string[] input = File.ReadAllLines($"../../../Input/{Year}/day{DayNumber}.txt");
|
|
|
|
Part1(input);
|
|
Part2(input);
|
|
|
|
if (bigBoi)
|
|
{
|
|
BigBoi(File.ReadAllLines($"../../../Input/{Year}/BigBoi/day{DayNumber}.txt"));
|
|
}
|
|
}
|
|
|
|
public abstract void Part1(string[] input);
|
|
|
|
public abstract void Part2(string[] input);
|
|
|
|
public abstract void BigBoi(string[] input);
|
|
}
|
|
} |