Initial Commit

This commit is contained in:
Jose Caban
2025-11-30 20:28:10 -05:00
commit e9ac699e67
209 changed files with 39737 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
namespace AdventCommon
{
public class PuzzleInput
{
public PuzzleInput(string fileName, bool ignoreEmptyLines = true)
{
using (StreamReader reader = System.IO.File.OpenText(fileName))
{
while (!reader.EndOfStream)
{
string? line = reader.ReadLine();
if (line == null) { throw new InvalidDataException(); }
if (ignoreEmptyLines && String.IsNullOrWhiteSpace(line)) continue;
Lines.Add(line);
}
}
}
public List<string> Lines { get; private set; } = new List<string>();
public void Print()
{
for (int j = 0; j < Lines.Count; j++)
{
for (int i = 0; i < Lines[j].Length; i++)
{
Console.Write(Lines[j][i]);
}
Console.WriteLine();
}
}
}
}