Skip to content

paljinov/c-sharp-advent-of-code

Repository files navigation

C# (C-Sharp) Advent of Code solutions

Tasks solutions:

Year Stars
2015 50 ⭐
2016 50 ⭐
2017 50 ⭐
2018 50 ⭐
2019 50 ⭐
2020 50 ⭐
2021 50 ⭐
2022 12 ⭐

Prerequisites for running project

Copy ./src/.env.example to ./src/.env file and set year, day and part for task you wish to debug or run.

Local development:

Run watcher, runs source code on file change:

dotnet watch --project ./src/AdventOfCode.csproj run

Run source code:

dotnet run --project ./src/AdventOfCode.csproj

Docker development:

Run watcher, run source code on file change:

  1. Build and compose project
    docker-compose -f docker-compose.yml -f docker-compose.watch.yml build \
        --build-arg USER_NAME=$(whoami) --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)
    
    docker-compose -f docker-compose.yml -f docker-compose.watch.yml up -d --force-recreate
    or
    docker-compose -f docker-compose.yml -f docker-compose.watch.yml up -d --force-recreate --build
  2. Get a bash shell in the app running container:
    docker-compose exec app /bin/bash
  3. Run watcher:
    dotnet watch run

Debug configuration:

  1. Build and compose project
    docker-compose -f docker-compose.yml -f docker-compose.debug.yml up -d --force-recreate --build
  2. Get a bash shell in the app running container:
    docker-compose exec app /bin/bash
  3. Run assembly:
    dotnet run

Release configuration:

  1. Build and compose project
    docker-compose up -d --force-recreate --build
  2. Get a bash shell in the app running container:
    docker-compose exec app /bin/bash
  3. Run assembly:
    dotnet AdventOfCode.dll

Check app container logs:

docker-compose logs -ft app

Docs:

About

C# (C-Sharp) Advent of Code solutions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages