My solutions to the Advent of Code, years 2023 and 2024.
- Usage instructions are here.
- The source code is here.
- My puzzle inputs are here. (In a private repo.)
Also includes my solutions for Project Euler.
- The source code is here. (In a private repo.)
Advent of Code does not allow sharing puzzle inputs, and Project Euler does not allow sharing solutions. Therefore, these are stored in separate, private repositories. These repositories are included as git submodules. In other words: Where needed, this repository contains a link to a specific commit in another repository.
If you do not have access to that repository, you can still clone this project as normal and inspect my solutions. However, to run my Advent of Code solutions, you will have to provide your own puzzle inputs. For further information, check the instructions in the Advent of Code submodule.
In general, the following usage instructions apply.
# Clone without submodules
git clone git@github.com:FWDekker/aoc.git
# Clone with submodules
git clone git@github.com: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
If you have made changes in a submodule rooted at dir/
, you have to cd dir
before you can git commit
.
After doing so, the root repository will be outdated, since it still points to a specific commit, not to the head of your specific branch.
You will have to update the submodule reference manually using a plain git add dir
from within the root repository.
To allow 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.md
s for more information.
You can run tasks as follows:
# Run day 4 of Advent of Code year 2023
gradlew :aoc:run -Pday=2023.4
# Run problem 19 of Euler Project
gradlew :euler:run -Pproblem=19
# 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"
# Run all tests for AoC 2024
gradlew test --tests "com.fwdekker.aoc.y2024.*"
# Run all tests for AoC 2024 (not fully implemented yet)
gradlew :aoc:test -Pkotest.tags="2024"