This repository contains my solutions for the Advent of Code programming puzzles. The Advent of Code is an annual event that takes place every December, where a new programming puzzle is released each day leading up to Christmas.
To run the code in this repository, you'll need to have the following installed on your machine:
- Java JDK (version 17 or later)
- Maven (version 3.6 or later)
- Clone the repository to your local machine:
git clone https://github.com/alglus/advent-of-code.git
- Navigate to the project root directory:
cd advent-of-code
- Build the project using Maven:
mvn clean install
To run the code for a specific day, use the following command:
mvn exec:java -Dexec.mainClass=aoc<year>.Day<day>
<year>
: the year of the Advent of Code (e.g., 2022)<day>
: the day of the puzzle, with single digits preceded by a zero (e.g., 01)
For example, to run the code for Day 1 of the 2022 event, use the following command:
mvn exec:java -Dexec.mainClass=aoc2022.Day01
The output of the program will be printed to the console.
To run all tests, use the following command:
mvn test
If you would like to run the tests of a specific day, run:
mvn -Dtest=aoc<year>.Day<day>Tests test
So, for example, to run the tests of Day 2 of the 2022 event, run the following:
mvn -Dtest=aoc2022.Day02Test test
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.