- Notifications
You must be signed in to change notification settings - Fork2
Advent of Code 2024 solutions using a different language for each day
License
fwcd/advent-of-code-2024
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
My solutions to theAdvent of Code 2024, written in 25 different programming languages.
- Day 01:PowerShell
- Day 02:Nix
- Day 03:Perl
- Day 04:C
- Day 05:Prolog
- Day 06:Zig
- Day 07:Curry
- Day 08:PHP
- Day 09:JavaScript
- Day 10:Groovy
- Day 11:Lua
- Day 12:Objective-C
- Day 13:Python
- Day 14:Haskell
- Day 15:C++
- Day 16:Kotlin
- Day 17:C# (using Z3 to solve part 2)
- Day 18:Java
- Day 19:PyGyat
- Day 20:Rust
- Day 21:Scala
- Day 22:Dart
- Day 23:Go
- Day 24:Crystal
- Day 25:Swift
The programs are packaged withNix, a functional package manager for Linux and macOS that focuses on reproducible builds. This makes it easy to build the programs, both locally and CI, without relying on system packages.
To build one of the days,cd into the corresponding directory and build and/or run the Nix flake. For example, to run day 1, use the following commands:
cd day01nix run. resources/input.txt
Every day is packaged up to take exactly one command-line argument, the input file, and usually includes the demo input from the exercise too.
Tip
The build environment can be added to the currentPATH usingnix develop. This is useful to manually run the compiler.
- Dijkstra, Dijkstra, Dijkstra (day16,18,20)
- TheLanternfish-style counting trick seems to be useful (day11,21)
- See e.g. alsothis Reddit post orthis one
- Plot graph-like inputs with GraphViz (day23,24)
- In some cases, the solution is visually apparent in the plot (23.2)
- Use bigger ints, ideally at least 64-bits (day17,21,24)
My solutions to the previous challenges can be found here:
About
Advent of Code 2024 solutions using a different language for each day
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.