What is this? My solutions for the Advent of Code programming challenge in year 2023. If you would like to know more about it, you can read about it here: https://adventofcode.com/
... maybe this year I'll be patient enough to solve all the puzzles.
- https://gitlab.com/kodfodrasz/advent-of-code-2018
- https://gitlab.com/kodfodrasz/advent-of-code-2020
- https://github.com/kodfodrasz/advent-of-code-2022
- ensure you have at least .Net SDK 8.0 installed
- clone the repository
- change directory to the cloned repository root
- set two environment variables:
AOC_DATA_DIR
to a directory path where the downloaded puzzle inputs will be cached.AOC_SESSION_COOKIE
is needed to download the puzzle inputs if not found in the cache. You can get it from your browser using web inspector after logging in to the AoC site.
dotnet run -c Release --project .\Kodfodrasz.AoC.Cli\Kodfodrasz.AoC.Cli.fsproj
No CI releases are planned now.
This mostly a note to self at the moment
-
ensure you have at least .Net SDK 8.0 installed
-
clone the repository
-
change directory to the cloned repository root
-
build a single file binary
# This example is for powershell # You may need to change the platform identifier [RID](https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/rid-graph). $target_rid="win-x64" dotnet publish -c Release ` -f net8.0 -r $target_rid ` --self-contained true ` -p:PublishSingleFile=true ` -p:EnableCompressionInSingleFile=true ` -p:IncludeAllContentForSelfExtract=yes ` .\Kodfodrasz.AoC.Cli\Kodfodrasz.AoC.Cli.fsproj $result_dir="Kodfodrasz.AoC.Cli\bin\Release\net8.0\$target_rid\publish\" echo "The binary is in $result_dir"
-
You can now run the binary on another computer, and it doesn't need to have the relevant .Net Runtime/SDK installed! The environment variables
AOC_DATA_DIR
andAOC_SESSION_COOKIE
mentioned above will still needed to be set up on the target machine
There are lots of stuff missing from the library used to solve the puzzles.
- CI
- Memoization helper based on System.Runtime.Caching.MemoryCache
- Transpose
- Rotate CW/CCW 90°, 180°
- Mirror X
- Mirror Y
- Sequential iterator by row
- Sequential iterator by column
- Extend in each dimension with default value
- Apply convolution matrix 3x3
- Apply convolution matrix 5x5
- Between (inclusive, exclusive, upper/lower inclusive)
Edit Distances:
- Hamming distance (same length)
- Lewenstein distance (any length)
- Longest Common Substring
- Manhattan distance
- Chebyshev distance
- Eucledian distance
- Haversine formula (great-circle distance on surface of a sphere)
Shortest path
- Dijkstra
- Floyd-Warschal
- Bellman-Ford (shortest path, generates all paths from one node as a byproduct)
Circle detection
- Floyd
Topological Sorting
- Kahn's algorithm
- Shuffle
- Power set
- Cartesian product1
- Cartesian product of single set on itself, except diagonal (Does this have a fancy name?)
- Cartesian product single set on itself, only top triangular matrix, except diagonal (Does this have a fancy name?)
- Largest Common Denominator
- Least Common Multiple
- Prime factorization
- Prime sequence generation
- Primality test
- Coprimality test
- K-Combination
- Power set
- Binomial
- Hungarian method
- Backtracking
Footnotes
-
Magyarul/In Hungarian: Descartes-szorzat ↩