Skip to content

danielemegna/dotnet-aoc-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Advent Of Code 2023

Solutions for 2023 Advent Of Code challenges in C#

Challenge solutions are in tests as assertions:

[Fact]
public void SolveWithFile()
{
  var input = File.ReadAllLines("day4/input.txt");
  var actual = solver.SomethingToSolve(input);
  Assert.Equal(20667, actual);
}

Docker-only dev setup

Use temporary container with current directory volume:

$ docker run --rm -it -v $PWD:/app -w /app mcr.microsoft.com/dotnet/sdk:8.0 bash
# dotnet build aoc2023.csproj
# dotnet test --logger "console;verbosity=normal" aoc2023.csproj
# dotnet test --logger "console;verbosity=normal" aoc2023.csproj --filter aoc2023.day2

VSCode Dev Container setup

VSCode can use devcontainers to be configured with the proper extensions and without dotnet executable locally installed.

In order to proceed, install the related extension (ms-vscode-remote.remote-containers) and reopen vscode in Dev Container mode.

the first run can take some minutes to install and setup properly container and vscode extensions

If you want to open an additional bash session in the vscode container:

$ docker exec -it -w /workspaces/$(basename $PWD) <container-name> bash
# dotnet test --logger .........

About

adventofcode.com/2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages