Skip to content
/ aoc Public

My solutions to the Advent of Code.

Notifications You must be signed in to change notification settings

FWDekker/aoc

Repository files navigation

Advent of Code

My solutions to the Advent of Code. The source code is here.

Also includes my solutions for Project Euler. The source code is here. (It's in a private repo.)

Git submodules

Project Euler does not allow sharing solutions. Therefore, the code for Project Euler is stored in a private repository. This repository is included as a git submodule. In other words, this repository contains a link to a specific commit in that other repository.

Note the following usage instructions.

# Clone without submodules
git clone [email protected]:FWDekker/aoc.git
# Clone with submodules
git clone [email protected]:FWDekker/aoc.git --recurse-submodules

# Add missing submodules after cloning
git submodule update --init --recursive
# Update submodules to respective HEADs
git submodule update --recursive --remote

To commit changes you've made in the euler/ directory, run

cd euler; git commit

Now, the root repository will be outdated, since the local repository inside euler/ no longer matches the commit referred to by the root repository. Therefore, you'll have to commit the changes there as well (but don't fret if you forget).

Gradle sub-projects

To allow code Advent of Code and Project Euler to be built separately, but still use a common codebase, the repository has been structured using Gradle subprojects. This repository has the following subprojects:

  • buildSrc: Common build logic for all subprojects.
  • std: Utility and helper functions for other subprojects.
  • aoc: Advent of Code.
  • euler: Project Euler.

Check their respective README.mds for more information.

You can run tasks as follows:

# Run all tests in all subprojects
gradlew test
# Run all tests in subproject 'aoc'
gradlew :aoc:test
# Run tests tagged with "Foo" in subproject 'aoc'
gradlew :aoc:test -Pkotest.tags="Foo"