https://github.com/GiantTreeLP/AOC-Kotlin
Advent of Code 2024 in Kotlin
https://github.com/GiantTreeLP/AOC-Kotlin
aoc-2024-in-kotlin
Last synced: 10 months ago
JSON representation
Advent of Code 2024 in Kotlin
- Host: GitHub
- URL: https://github.com/GiantTreeLP/AOC-Kotlin
- Owner: GiantTreeLP
- License: mit
- Created: 2024-12-08T20:05:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T21:07:38.000Z (over 1 year ago)
- Last Synced: 2024-12-15T22:18:25.523Z (over 1 year ago)
- Topics: aoc-2024-in-kotlin
- Language: Kotlin
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AOC 2024 in Kotlin
[](LICENSE)
This repository contains my solutions for the [Advent of Code](https://adventofcode.com/) puzzles in the Kotlin programming language.
## Running the solutions
The solutions are organized by year and day. Each day has its own file,
which contains the solution for both parts of the puzzle.
The boilerplate for new solutions is:
```kotlin
package yearXXXX
import com.google.auto.service.AutoService
import common.AOCSolution
@AutoService(AOCSolution::class)
class DayXX : AOCSolution {
override val year = XXXX
override val day = XX
override fun part1(inputFile: String): String {
TODO("Solve part 1 here")
}
override fun part2(inputFile: String): String {
TODO("Solve part 2 here")
}
}
```
Commonly used functions, classes and extensions can be found in the `common` package.
Input is expected to be in a file named `input` in the resources folder of the corresponding year and day.
The same goes for the sample input, which is expected to be in a file named `sample`.
The layout of the directories is as follows:
```
- src
- main
- kotlin
- year2024
- dayXX.kt
- resources
-yearXXXX
- dayXX
- input
- sample
```
To run the solutions, simply run the `main` function of the [`common.Runner`](src/main/kotlin/common/runner.kt) file.
Don't expect the code to be perfect, I'm trying to solve the puzzles in a way that is good enough for me.