Starter template for solving Advent of Code in Kotlin
- Starter .gitignore
- Junit and Hamcrest test libraries included (see Testing below)
- Gradle setup so you can run a specific day or all days on the command line (see Running below)
Project is already setup with gradle. To run the app:
- Navigate to top-level directory on the command line
- Run
./gradlew runto run all days - Run
./gradlew run --args $DAYwhere$DAYis an integer to run a specific day
Project includes Junit and Hamcrest and a stub unit test to get you going. To run all tests:
- Navigate to top-level directory on the command line
- Run
./gradlew test - Add
--info,--debugor--stacktraceflags for more output
- Inputs go into
src/main/resourcesand follow the naming conventioninput_day_X.txt - Solutions go into
src/main/kotlin/daysand extend theDayabstract class, callings its constructor with their day number - Solutions follow the naming convention
DayX - It is assumed all solutions will have two parts but share the same input
- Input is exposed in the solution classes in two forms -
inputListandinputString - Day 1 solution class and input file are stubbed as a guide on how to extend the project
- To get started simply replace
input_day_1.txtwith the real input and the solutions inDay1with your own