Find all the solutions to the Advent of Code 2024 written in Kotlin and organized by day with the respective inputs in the resources folder.
The funniest day, for me, was Day 15! I had a lot of fun implementing a visual mode simulation, have look at it:
./gradlew clean build
./gradlew generateJar -PmainFile=Day15.ktMake sure to use Java SDK 21+ for running the Jar.
java -jar build/libs/days/Day15.jarTo stop the simulation press ctrl + C.
Note that the IDE terminal may not support properly the ANSI escaping sequence which makes the simulation output smooth. I recommend running it in iTerm2 (macOS), Windows Terminal (Windows), and GNOME Terminal (Linux) terminals.
I loved the surprise hidden in the output of the second part of Day 14! You Must Run It!
./gradlew clean build
./gradlew generateJar -PmainFile=Day14.kt
java -jar build/libs/days/Day14.jarThis project provides the script PrepareWorkTask.kt which is handy to get started with the implementation for the solution of a new Day. It can be used with the command:
./gradlew PrepareWorkTask -Pday="day26" -Ppkg="edu.adarko22"The script generates the Day26.kt file in the kotlin sources in the solutions module, with the predefined code
structure.
This project provides also the script GenerateJar.kt to generate a runnable Jar for all or a specific file:
./gradlew generateJar -Pall=true./gradlew generateJar -PmainFile=DayX.kt
The jar files will be available in the build/libs/days/ folder.