Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fstaudt/advent-of-code

Solutions for Advent of Code
https://github.com/fstaudt/advent-of-code

advent-of-code aoc-2023 aoc-2023-in-kotlin

Last synced: about 4 hours ago
JSON representation

Solutions for Advent of Code

Awesome Lists containing this project

README

        

# advent-of-code

## Solutions

- [2023](aoc2023/src/main/kotlin/com/github/fstaudt/aoc2023)

## Gradle tasks

### Leaderboard slope chart

generate a slope chart for a private leaderboard

#### How-to

- clone repository

- store Advent of Code `Cookie` request header in file `cookie.txt`

- run command:
``` shell
./gradlew leaderboardSlopeChart --year= --id= [--top=] [--force] \
[--from=] [--until=] [--final]
```
- `year`: year of advent calendar
- `id`: ID of private leaderboard
- `top`: number of top members displayed in slope chart
- `force`: force download of leaderboard JSON\
_By default, download is skipped if file `build/aoc/leaderboards//.json` already exists._\
:warning: _Please don't make frequent automated requests to Advent of code API._\
:warning: _Avoid download of leaderboard JSON more often than once every 15 minutes (900 seconds)._
- `from`: first day displayed in slope chart (default: 1)
- `until`: last day displayed in slope chart (default: 25)
- `min`: minimum required number of appearances in top for members not in top on last day (default: 2)
- `final`: include final ranking in slope chart

- Slope chart is generated in `build/aoc/leaderboards//.json.png`

#### Example
``` shell
./gradlew leaderboardSlopeChart --year=2023 --id=12345 --top=10 # example uses a fake id
```

![Leaderboard slope chart](./examples/12345.png)

### Init day

generate base sources for requested day

#### How-to

- clone repository

- run command:
``` shell
./gradlew initDay [--day=] [--year=] [--force]
```
- `day`: day in advent calendar (defaults to current day of month)
- `year`: year of advent calendar (defaults to current year)
- `force`: overwrite existing sources

### Fetch day input

fetch input of current user for requested day

#### How-to

- clone repository

- store Advent of Code `Cookie` request header in file `cookie.txt`

- run command:
``` shell
./gradlew fetchDayInput [--day=] [--year=]
```
- `day`: day in advent calendar (defaults to current day of month)
- `year`: year of advent calendar (defaults to current year)