Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sizableshrimp/adventofcode2023
My solutions for the Advent of Code 2023 challenges
https://github.com/sizableshrimp/adventofcode2023
advent-of-code advent-of-code-2023 advent-of-code-java advent-of-code-kotlin adventofcode adventofcode2023 aoc-2023-in-java aoc-2023-in-kotlin
Last synced: about 2 months ago
JSON representation
My solutions for the Advent of Code 2023 challenges
- Host: GitHub
- URL: https://github.com/sizableshrimp/adventofcode2023
- Owner: SizableShrimp
- License: mit
- Created: 2023-11-27T05:11:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-27T17:19:03.000Z (about 1 year ago)
- Last Synced: 2023-12-27T18:30:21.337Z (about 1 year ago)
- Topics: advent-of-code, advent-of-code-2023, advent-of-code-java, advent-of-code-kotlin, adventofcode, adventofcode2023, aoc-2023-in-java, aoc-2023-in-kotlin
- Language: Java
- Homepage: https://adventofcode.com/2023
- Size: 196 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AdventOfCode2023
This repository holds my solutions and helper code (in Java/Kotlin) for [Advent Of Code 2023](https://adventofcode.com/2023).
A large part of the util code is based on code I have built up from prior years which you can find in my other AOC GitHub repos.## Technical Information
This repository supports downloading and caching input data from the Advent Of Code servers.
To set up, you must create a `session.txt` file in the program working directory which holds your session cookie from the Advent Of Code website.
This cookie expires after a month, so it has to be updated from time to time.Each day's input file is formatted as `dayXX.txt`. If the day is 1-9, then the file will be named `day01.txt`, `day02.txt`, etc.
When running a specific day, the program will look for an input file in the following order:
1. Checks the `days` folder on the classpath, if it's there.
2. Checks the `aoc_input` folder in the current working directory, if it's there.
3. If there's a `session.txt` file with a logged-in cookie, it downloads the input from the AOC servers and saves it to the `aoc_input` folder (creating it if necessary).
4. If the input file can't be found, it throws an exception.The `session.txt` file should be a single line and should contain your session cookie from the AOC website.
You can find this cookie by logging into the AOC website, opening the developer tools, and looking for the "session" cookie.
Only the cookie's value should be pasted into the file.### Running A Specific Day
This program runs a specific day based on a few factors inside the `Main` class.
If it is the month of December in EST time and the 25th or earlier, whatever current day it is in EST time will be selected to run.
If this program is not run during Advent season, it will run ALL days by default.
An output from a day looks like the following:
```text
Day 1:
Part 1: 123
Part 2: 456
Completed in 5.298ms
```
Note that "Completed in X.XXXms" is not a real or accurate benchmark, but an approximate measure of how long a day takes to run using nano time.
For real benchmarks, please see `gradle jmh` and the `benchmarks` package (which is still based on your specific hardware).
If you would like to run a specific day outside the month of the December, use `run(int)` in the `Main` class.