Skip to content

Tatum's C# Advent Of Code Solutions

Notifications You must be signed in to change notification settings

tatumroaquin/AoC-CSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C# Advent of Code Solutions

Adding New Years

dotnet new console --name "AoC-<YEAR>"
dotnet sln AdventOfCode.sln add AoC-<Year>

Adding Solutions

mkdir -p AoC-<Year>/00 Problem Title/Data
touch AoC-<YEAR>/00 Problem Title/InputParser.cs
touch AoC-<YEAR>/00 Problem Title/Part1.cs
touch AoC-<YEAR>/00 Problem Title/Part2.cs
touch AoC-<YEAR>/00 Problem Title/00 Test.cs
echo "namespace AoC_[YEAR].Day_[DAY];" > AoC-<YEAR>/00 Problem Title/*.cs

Getting Problem Text

# alternatively curl out the page yourself
curl -sL https://adventofcode.com/<year>/day/<day>

Getting Puzzle Data

AoC-/00 Problem Title/Data/ExampleInput.in
AoC-/00 Problem Title/Data/PuzzleInput.in

Testing Solutions

  • The 00 Test.cs file inside each day must contain the following boilerplate
// 00 Test.cs
public class AoC_[YEAR]_Day_[DAY] {
  public static void Test() {
    /* ... */
  }
}
  • In AoC_<YEAR>/Program.cs call the Test() method of each problem you're testing:
// AoC_<YEAR>/Program.cs
using AoC_[YEAR].Day_[DAY];
public static void Main() {
  AoC_[YEAR]_Day_01.Test();
  AoC_[YEAR]_Day_02.Test();
  AoC_[YEAR]_Day_03.Test();
  /* ... */
}