Welcome to the Advent of Code1 Kotlin project created by maiatoday using the Advent of Code Kotlin Template delivered by JetBrains.
This repository, has been heavily modified to my workflow. It is still used for solutions using Kotlin language, however it has some scripts and testing built in and a collections of libraries I built up over the time I have been doing these challenges.
- Pick the latest starter branch or head of main and make a fresh branch for the year
- Setup the data download script
- Add an env variable for
$ADVENT_SESSION
and$ADVENT_USER_AGENT
- Test the script with this command
aoc 1
It should download day 1 data - Change the year in the script to point to the correct url
- Add an env variable for
- Update any Kotlin versions or gradle versions
- Run some tests to see if everything still works
- There are two options to work, either call the day code in the Main.kt or setup tests in the DayXX test file.
- The build should be setup to use benchmarks, there is a test that shows how to run these.
- Run the benchmarks with
./gradlew benchmark
- There are some generalised utils in utils package. InputUtils for various input handling, GridUtils for some point and 3d point utilities.
The steps each day:
- Setup the day code with new file Dayxx and live template
aoc
- Generate a test file and use
taoc
live template, populate imports - Download test data and read question and get cracking to submit for ⭐️⭐️
More info
- Kotlin docs
- Kotlin Slack
- Template issue tracker
Footnotes
-
Advent of Code – an annual event in December since 2015. Every year since then, with the first day of December, a programming puzzles contest is published every day for twenty-four days. A set of Christmas-oriented challenges provide any input you have to use to answer using the language of your choice. ↩