Skip to content

🎁 A template repository for an advent of code project in an enterprise-style codebase with an emphasis on design, readability and testing.

License

Notifications You must be signed in to change notification settings

TomPlum/advent-of-code-template

Repository files navigation

🎄 Advent of Code {YEAR}

GitHub

How to use this template

See examples of this template being used in my previous Advent of Code projects.

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.

What is Advent of Code?

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."

Contents

Getting Started

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.name property in settings.gradle.kts to advent-of-code-{year}
  • Also make sure the run config XML files in the .run directory have the name attribute 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 this Getting Started section from here and the table of contents.

Gradle Tasks

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.

IntelliJ Run Configurations

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.

The Days

The Most Fun

The Most Interesting

The Most Challenging

Answer Table

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

Advent Calendar

A .GIF of the complete animated calendar goes here once completed.

About

🎁 A template repository for an advent of code project in an enterprise-style codebase with an emphasis on design, readability and testing.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •