Skip to content

v2.0

Choose a tag to compare

@pBouillon pBouillon released this 04 Dec 16:18
· 10 commits to main since this release
5ff5a6f

Remote puzzle input handling

You can now change how your input is retrieved when creating your Solver.

For the one using a local input, specify its path in the constructor:

public class Solver : Solver<int[], int>
{
    public Solver() : base(inputPath: "WithLocalInput/input.txt") { }
    // ...
}

And for the remote input, specify instead the year and the date of the puzzle:

public class Solver : Solver<int[], int>
{
    public Solver() : base(year: 2022, day: 4) { }
    // ...
}

For this to work, you will need to set your Advent of Code cookie, please refer to the troubleshooting section of the readme to do so

Disable tests on demand

If you want to skip the tests of a part of a given puzzle, all you need to set is ShouldSkipTests to true and the tests linked to this puzzle part will be skipped:

public class SolverTest : TestEngine<Solver, int[], int>
{
    // Tests for the example and puzzle input will be skipped
    public override Puzzle PartOne => new()
    {
        ShouldSkipTests = true,
        Example = new()
        {
            Input = new[] { 199, 200, 208, 210, 200, 207, 240, 269, 260, 263 },
            Result = 7,
        },
        Solution = 1696,
    };

    public override Puzzle PartTwo => new()
    {
        Example = new()
        {
            Input = new[] { 199, 200, 208, 210, 200, 207, 240, 269, 260, 263 },
            Result = 5,
        },
        Solution = 1737,
    };
}

Lazily access the puzzle input

Instead of fetching and parsing the puzzle input on creation, this will now be done only when querying it the first time