See examples of this template being used in my previous Advent of Code projects.
- advent-of-code-2019 was the year that establish the format of the codebase.
- advent-of-code-2020 improved it a little bit.
- advent-of-code-2021 another usage...
- advent-of-code-2022 another usage...
- advent-of-code-2023 another usage...
- advent-of-code-2024 another usage...
Also see advent-of-code-libs where a lot of common code has been extracted. It's compiled in this template via Gradle and is pulled from the GitHub packages registry.
Excerpt from the Advent of Code website;
"Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets
and skill levels that can be solved in any programming language you like. People use them as a
speed contest, interview prep, company training, university coursework, practice problems, or
to challenge each other."
Simply clone or download the repository into your local environment and import it as a Gradle project in your IDE. Running Solutions.kt will run the parts from all the completed days, reporting all the answers and runtimes in the console.
- Don't forget to change the
rootProject.nameproperty insettings.gradle.ktstoadvent-of-code-{year} - Also make sure the run config XML files in the
.rundirectory have thenameattribute in the<module name="advent-of-code-template.solutions.main" />tag updated to match the current years name. - Also update the
{YEAR}in the heading anchor at the top and remove thisGetting Startedsection from here and the table of contents.
| Task | Description |
|---|---|
test |
Runs the unit tests with coverage for the implementation, solutions and common sub-projects. |
detekt |
Runs DeteKT with the custom configuration rules defined in detekt-config.yml. |
The .run directory contains XML configuration files from IntelliJ. Included are configurations for running the unit
tests in the common, implementation and solutions Gradle sub-projects as well as for each specific day.
| Day | Part 1 Answer | Avg Time | Part 2 Answer | Avg Time | Documentation |
|---|---|---|---|---|---|
| 01 | 4123 | 9ms | 1653 | 123ms | Day Name |
| 02 | - | - | - | - | |
| 03 | - | - | - | - | |
| 04 | - | - | - | - | |
| 05 | - | - | - | - | |
| 06 | - | - | - | - | |
| 07 | - | - | - | - | |
| 08 | - | - | - | - | |
| 09 | - | - | - | - | |
| 10 | - | - | - | - | |
| 11 | - | - | - | - | |
| 12 | - | - | - | - | |
| 13 | - | - | - | - | |
| 14 | - | - | - | - | |
| 15 | - | - | - | - | |
| 16 | - | - | - | - | |
| 17 | - | - | - | - | |
| 18 | - | - | - | - | |
| 19 | - | - | - | - | |
| 20 | - | - | - | - | |
| 21 | - | - | - | - | |
| 22 | - | - | - | - | |
| 23 | - | - | - | - | |
| 24 | - | - | - | - | |
| 25 | - | - | - | - |
Average Execution Time: 646ms
Total Execution Time: 15s 441ms
i7 5820K - OpenJDK 14.0.2 - Ubuntu 20.04
A .GIF of the complete animated calendar goes here once completed.