Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wverlaek/adventofcode
Advent of Code solutions written in Kotlin
https://github.com/wverlaek/adventofcode
aoc-2021-in-kotlin aoc-2022-in-kotlin aoc-2023-in-kotlin
Last synced: 27 days ago
JSON representation
Advent of Code solutions written in Kotlin
- Host: GitHub
- URL: https://github.com/wverlaek/adventofcode
- Owner: WVerlaek
- Created: 2021-12-05T17:07:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-25T10:30:56.000Z (12 months ago)
- Last Synced: 2024-10-14T15:56:09.003Z (2 months ago)
- Topics: aoc-2021-in-kotlin, aoc-2022-in-kotlin, aoc-2023-in-kotlin
- Language: Kotlin
- Homepage:
- Size: 23.4 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent of Code
:star: https://adventofcode.com/
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/wverlaek/adventofcode)
Advent of Code solutions, written in Kotlin.
## Solution framework
A small framework is created to speed up solving a day's puzzle:
* Input is automatically read from the AoC API
* Unit tests using each day's sample input to verify solutions
* Answers are automatically uploaded and outcome is shown
* Common package for utitilities and datastructuresAdditionally, uses IntelliJ [live templates](https://www.jetbrains.com/help/idea/creating-and-editing-live-templates.html):
* Template to solve a day's puzzle
* Template to unit test a solution with sample inputOr, run the following to generate a source + test file for a new day:
```console
./workflow/new.sh []
```A GitHub Action is configured to run all unit tests on each commit.
## Automatic answer submission
Using a session token for the Advent of Code API, the day's input is automatically read, and your solution is uploaded on each run with the outcome printed afterwards:
```console
$ gradle run
Answer for 2022/3 level 2: '2581' (took 28ms)
Response: right answer!
```No need to manually download inputs and upload your answers :zap:
#### Set up API session token
The session token needed to read input and upload answers can be set up as follows:
* Log in on https://adventofcode.com/
* Read the `session` cookie
* Put its value in this file: `.secrets/session` (.gitignored)
* Or set it as env var `AOC_SESSION`, e.g. in the Gitpod user settings to have it automatically used in Gitpod workspaces.