My solutions to Advent of Code puzzles in Kotlin!
2024: 50/50⭐
Missing implementations:
- Day 24 (part 2): solution is mostly manual, it's difficult to implement in code
- JDK 21
git clone https://github.com/wezik/aoc-kotlin.git
cd aoc-kotlin
./gradlew buildFat
source ./alias.sh
git clone https://github.com/wezik/aoc-kotlin.git
cd aoc-kotlin
.\gradlew buildFat
This project provides 2 separate CLI entrypoints: aoc and aot.
These are executed via shell or batch scripts, allowing you to use them like a regular CLI tool.
The entrypoint scripts are:
- alias.sh for Linux/macOS - defines
aoc
andaot
functions - aoc.bat for Windows - runs
aoc
- aot.bat for Windows - runs
aot
Note
These scripts are meant to be run from the project directory,
they do not install anything globally or add commands to your system PATH
.
After building the project (and sourcing aliases for Linux/macOS with source ./alias.sh
)
You can invoke them like:
aoc -d 5
aot -d 3 --path "inputs/Day03.txt"
Or in Powershell:
.\aoc.bat -d 5
.\aot.bat -d 3 --path "inputs/Day03.txt"
Loads inputs directly from Advent of Code website to run solutions against.
Important
It runs against advent of code inputs, which requires session cookie, you can either:
- export ADVENT_COOKIE ex.
export ADVENT_COOKIE="xxx"
- provide session cookie via option ex.
-s "session_cookie"
Usage: aoc [<options>]
Options:
-d, --day=<int> Day
-y, --year=<int> Year (defaults to last advent of code year)
-s, --session-cookie=<text> Session cookie (defaults to "ADVENT_COOKIE" env variable)
-h, --help Show this message and exit
Loads inputs from files instead of running solutions against real ones.
You can provide --path
to load custom input, otherwise it will load examples.
Usage: aot [<options>]
Options:
-d, --day=<int> Day
-y, --year=<int> Year (defaults to last advent of code year)
-p, --path=<path> Path with custom input file to load
-h, --help Show this message and exit
- Introduce releases so it's not necessary to build from source