AdventOfCode.Framework
1.0.0
See the version list below for details.
dotnet add package AdventOfCode.Framework --version 1.0.0
NuGet\Install-Package AdventOfCode.Framework -Version 1.0.0
<PackageReference Include="AdventOfCode.Framework" Version="1.0.0" />
<PackageVersion Include="AdventOfCode.Framework" Version="1.0.0" />
<PackageReference Include="AdventOfCode.Framework" />
paket add AdventOfCode.Framework --version 1.0.0
#r "nuget: AdventOfCode.Framework, 1.0.0"
#:package AdventOfCode.Framework@1.0.0
#addin nuget:?package=AdventOfCode.Framework&version=1.0.0
#tool nuget:?package=AdventOfCode.Framework&version=1.0.0
Advent of Code Framework
Simple framework to bootstrap Advent of Code solutions.
Setup
To kick of the process, SolutionRunner.Run needs to be called.
new SolutionRunner().Run(args);
This takes an optional argument which specifies a subdirectory which contains the input files. If specified, relative paths from a SolutionInput attribute will be resolved relative to this directory.
The passed in arguments can define two modes:
"run <day> [problem]"
Runs the solution associated with a specific day. If a problem is specified then only that problem will run. Otherwise both problems will be run.
"benchmark [day] [problem]"
Runs a benchmark for the specified day. If no day is provided, then a benchmark will be run for all solutions. If a problem is specified then only that problem will run. Otherwise both problems will be run.
Solutions
A solution needs to satisfy four constrains: inheriting from Solution, having a constructor which takes in a single parameter of type Input, having a single Solution attribute, having at least one SolutionInput attribute.
A solution should then look something like this:
using AdventOfCode.Framework;
[Solution(1)]
[SolutionInput("Input.txt")]
public class MySolution : Solution
{
public MySolution(Input input) : base(input)
{
}
protected override string Problem1()
{
}
protected override string Problem2()
{
}
}
Input
Input is read by the framework and can be accessed in the solution via the Input property (or directly in the constructor).
Process
Each problem run instantiates a new solution, so state can't be shared between runs.
Benchmarking includes the runtime of the constructor as well as the specific problem, however it doesn't include reading input files.
Disabling Solutions, Problems and Inputs
Solutions can be disabled by passing in false to the Solution attribute, which means it will be ignored for runs and benchmarks. This is also the case with inputs which can be disabled via the SolutionInput attribute:
[Solution(1, Enabled = true)]
[SolutionInput("Input1.test.txt", Enabled = false)]
[SolutionInput("Input1.txt")]
public class MySolution : Solution
A problem that throws a NotImplementedException is not considered as having failed and therefore will not contribute to the benchmarks, or stop the current run.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2.6.2 | 235 | 12/6/2025 | |
| 2.6.1 | 227 | 12/6/2025 | |
| 2.6.0 | 229 | 12/6/2025 | |
| 2.5.2 | 206 | 12/5/2025 | |
| 2.5.1 | 204 | 12/5/2025 | |
| 2.5.0 | 219 | 12/3/2025 | |
| 2.4.1 | 439 | 11/30/2025 | |
| 2.4.0 | 424 | 11/30/2025 | |
| 2.3.0 | 755 | 11/30/2025 | |
| 2.2.0 | 694 | 11/30/2025 | |
| 2.1.0 | 689 | 11/30/2025 | |
| 2.0.0 | 765 | 11/30/2025 | |
| 1.3.8 | 528 | 12/14/2022 | |
| 1.3.2 | 439 | 12/13/2022 | |
| 1.3.0 | 652 | 12/11/2022 | |
| 1.2.1 | 463 | 12/8/2022 | |
| 1.1.2 | 472 | 12/3/2022 | |
| 1.1.1 | 448 | 12/3/2022 | |
| 1.1.0 | 451 | 12/3/2022 | |
| 1.0.0 | 447 | 12/2/2022 |