Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sschr15/advent-of-code
My solutions for Advent of Code problems
https://github.com/sschr15/advent-of-code
advent-of-code aoc-2024-in-kotlin kotlin
Last synced: 18 days ago
JSON representation
My solutions for Advent of Code problems
- Host: GitHub
- URL: https://github.com/sschr15/advent-of-code
- Owner: sschr15
- License: mit
- Created: 2020-12-02T14:26:09.000Z (about 4 years ago)
- Default Branch: 2024
- Last Pushed: 2024-12-21T20:26:01.000Z (about 2 months ago)
- Last Synced: 2024-12-21T21:24:44.628Z (about 2 months ago)
- Topics: advent-of-code, aoc-2024-in-kotlin, kotlin
- Language: Kotlin
- Homepage:
- Size: 116 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# advent-of-code
This is a repository containing my solutions to the
[Advent of Code](https://adventofcode.com/about) challenges as well as a
[compiler plugin](compiler-plugin) providing additional features for
ease of solving.## Getting challenge inputs
Puzzle inputs can be provided in two ways:
1. If a file named `session.txt` is provided in the run directory
(the root of the repository if run via Gradle), each challenge
will be downloaded using the session token provided in plain text
within that file.
2. Inputs can be manually placed into `inputs/YEAR/dayN` files, given
`YEAR` being the current four-digit year and `N` being a number 1 through 25.
The file may have a `.txt` extension, but it is not required.## Running all solutions
1. Install Java 21 or later and ensure it is the default version.
2. Run one of the gradle tasks:
1. `./gradlew run` - Runs all solutions in parallel, printing the results in order.
2. `./gradlew benchmark` - Runs each solution at least 250 times or at most five minutes,
for five seconds (or longer if the solution takes longer) and prints the average,
minimum, and maximum execution times as well as the standard deviation.
To best benchmark the multithreaded solutions, each is run on its own.If any exceptions are thrown, the program will catch them, print the error message,
and export the stack trace to a file named `dayN_error.txt`.
It will then continue to the next solution.## What's [`compiler-plugin`](compiler-plugin)?
This is a custom plugin providing an annotation for adding memoization
to functions as well as automatically checking for integer/long overflow.
To use it, add the following to a project's `build.gradle.kts`:```kotlin
val compilerPlugin by configurations.creatingdependencies {
implementation("com.sschr15.aoc:runtime-components:0.1.0")
compilerPlugin("com.sschr15.aoc:compiler-plugin:0.1.0")
}kotlin {
compilerOptions {
for (plugin in compilerPlugin) {
freeCompilerArgs.add("-Xplugin=${plugin.absolutePath}")
}
}
}
```I plan on providing a Gradle plugin at some point to avoid the need for manual configuration.