From 236e5f9ed358c2d4b95770946d10f2c06a0a6f34 Mon Sep 17 00:00:00 2001
From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com>
Date: Fri, 1 Dec 2023 21:41:35 -0600
Subject: [PATCH] docs: add xml comments
---
01/Trebuchet/Program.cs | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/01/Trebuchet/Program.cs b/01/Trebuchet/Program.cs
index bd3bc06..d90bb99 100644
--- a/01/Trebuchet/Program.cs
+++ b/01/Trebuchet/Program.cs
@@ -31,12 +31,30 @@ public class Program
}
}
+///
+/// Interface for puzzle solvers.
+///
public interface IPuzzleSolver
{
+ ///
+ /// Sums all calibration values.
+ ///
+ /// The lines of the input file.
+ /// The sum of all calibration values.
public int SumCalibrationValues(string[] lines);
+
+ ///
+ /// Gets the calibration value for a given line.
+ ///
+ /// The line to get the calibration value for.
+ /// The calibration value for the given line.
public int GetCalibrationValue(string line);
}
+///
+/// Puzzle solver for part one.
+///
+///
public class PartOnePuzzleSolver : IPuzzleSolver
{
public int SumCalibrationValues(string[] lines) => lines.Sum(GetCalibrationValue);
@@ -60,6 +78,10 @@ public class PartOnePuzzleSolver : IPuzzleSolver
}
}
+///
+/// Puzzle solver for part two.
+///
+///
public class PartTwoPuzzleSolver : IPuzzleSolver
{
private readonly Dictionary _validDigitsAsWords = new() {