Ved.AdventOfCode.Common 1.1.0

dotnet add package Ved.AdventOfCode.Common --version 1.1.0
                    
NuGet\Install-Package Ved.AdventOfCode.Common -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ved.AdventOfCode.Common" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ved.AdventOfCode.Common" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Ved.AdventOfCode.Common" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ved.AdventOfCode.Common --version 1.1.0
                    
#r "nuget: Ved.AdventOfCode.Common, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ved.AdventOfCode.Common@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ved.AdventOfCode.Common&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Ved.AdventOfCode.Common&version=1.1.0
                    
Install as a Cake Tool

AdventOfCode.Common

A utility library for Advent of Code solutions, providing helpers for input handling, ranges, and grid-based problems.

Classes

Range<T>

Represents a numeric range with a start and end value. Supports intersection, containment, and enumeration.

Example:

var range = new Range<int>(1, 10);
foreach (var i in range.Enumerate())
    Console.WriteLine(i); // 1 to 9
bool contains = range.Contains(5); // true
var intersection = range.Intersection(new Range<int>(5, 15)); // Range(5, 10)

Grid<T>

A 2D grid structure for storing and accessing elements by position. Supports indexers by row/col and by GridPos2d.

Example:

var grid = new Grid<int>(5, 5, 0); // 5x5 grid of zeros
grid[2, 3] = 42;
int value = grid[2, 3]; // 42
var pos = new GridPos2d(2, 3);
grid[pos] = 99;

GridPos2d

Represents a position in a 2D grid with Row and Col coordinates. Provides helpers for directions and adjacency.

Example:

var pos = new GridPos2d(2, 3);
var right = GridPos2d.Right; // (0, 1)
var down = GridPos2d.Down;   // (1, 0)
var neighbors = pos.AdjacentSide(); // Returns side-adjacent positions

InputHelper

Provides methods for reading input files, lines, and streams. Supports async operations and custom file systems.

Example:

// Read all lines from a file
var lines = await InputHelper.GetInput("input.txt");

// Read raw file content
var content = await InputHelper.GetRawInput("input.txt");

// Read file as a stream
using var stream = InputHelper.GetRawInputStream("input.txt");

Installation

Add the project to your solution and reference AdventOfCode.Common.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.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
1.1.0 422 12/8/2025