Skip to content

fstaudt/advent-of-code

Repository files navigation

advent-of-code

Solutions

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:

./gradlew leaderboardSlopeChart --year=<year> --id=<leaderboard-id> [--top=<top>] [--force] \
   [--from=<from>] [--until=<until>] [--final] [--ghosts]
  • 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/<year>/<id>.json already exists.
    ⚠️ Please don't make frequent automated requests to Advent of code API.
    ⚠️ 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 (default: false)

  • ghosts: include ghost members in slope chart (default: false)

  • Slope chart is generated in build/aoc/leaderboards/<year>/<id>.json.png

Example

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

Leaderboard slope chart

Init day

generate base sources for requested day

How-to

  • clone repository

  • run command:

./gradlew initDay [--day=<day>] [--year=<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:

./gradlew fetchDayInput [--day=<day>] [--year=<year>]
  • day: day in advent calendar (defaults to current day of month)
  • year: year of advent calendar (defaults to current year)