🎄 Advent of Code 🎄
My solutions in Kotlin
Legend: ★: Both stars for that day • ☆: Just the first star
Year |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
1 0 |
1 1 |
1 2 |
1 3 |
1 4 |
1 5 |
1 6 |
1 7 |
1 8 |
1 9 |
2 0 |
2 1 |
2 2 |
2 3 |
2 4 |
2 5 |
★ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2015 | ★️ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ☆ | ★ | 39 | |||||
2016 | ☆ | ☆ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ☆ | 21 | |||||||||||||
2017 | ★ | ★ | ★ | ★ | ★ | 10 | ||||||||||||||||||||
2018 | ★ | ★ | ★ | ★ | 8 | |||||||||||||||||||||
2019 | ★ | ★ | ★ | 6 | ||||||||||||||||||||||
2020 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ☆ | ☆ | ★ | ★ | ☆ | ★ | ☆ | 44 | |
2021 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | 26 | ||||||||||||
2022 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ☆ | ☆ | 28 | ||||||||||
2023 | ★ | ★ | ★ | ★ | ☆ | ★ | ☆ | 12 | ||||||||||||||||||
2024 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ☆ | ★ | ★ | ★ | ★ | ★ | ☆ | 40 |
Puzzles can be run using the Gradle run
task or by executing the project's JAR file:
-
All available puzzles (all years and days):
./gradlew run
orjava -jar build/libs/AdventOfCode.jar
-
All puzzles for a given year:
./gradlew run --args "2020"
orjava -jar build/libs/AdventOfCode.jar 2020
-
A single puzzle for a given year and day:
./gradlew run --args "2020/25"
orjava -jar build/libs/AdventOfCode.jar 2020/25
These arguments can be combined to run multiple puzzles, e.g.
./gradlew run --args "2015/1 2019 2020/6 2020/7"
will run the first puzzle from 2015, then all puzzles from 2019 and lastly the 6th and
7th puzzle from 2020.
Runtimes that exceed 15s are highlighted in red.
Legend: XXXX
: Year (4 digits, e.g. 2020
) • YY
: Day (leading zero, e.g. 07
) • ZZZZ
: Puzzle name (UpperCamelCase,
e.g. HandyHaversacks
)
- Inputs go into
src/main/resources/inputs
and follow the naming conventionyearXXXX/dayYY.txt
- Solutions go into
src/main/kotlin/adventofcode
and follow the naming conventionyearXXXX/DayYYZZZZ.kt
- Solutions extend the
Puzzle
class and call its constructor passing an optional alternative input - Solutions can have one or two parts sharing the same input. Not overriding
fun partTwo(): Any
will skip the second part when running the puzzle
- Check formatting:
./gradlew ktlintCheck
- Fix formatting:
./gradlew ktlintFormat