
A useful library I use to get started coding with Advent of Code
Report Bug
·
Request Feature
Table of Contents
This project is a framework for scala users to easily get started with Advent of Code submissions.
To get a local copy up and running follow these simple example steps.
-
java
brew install openjdk
-
scala
brew install scala
-
Set your cookie session
echo 'export AOC_COOKIE_SESSION="<cookie session>"' >> ~/.zshrc
-
Set your user agent
echo 'export AOC_USER_AGENT="https://github.com/yourrepo/AdventOfCode by [email protected]"' >> ~/.zshrc
-
Set the flag to submit answers programmatically
echo 'export AOC_SUBMIT_ANSWERS=true' >> ~/.zshrc
-
Set the throttle flag
echo 'export AOC_SUBMISSION_THROTTLE=5' >> ~/.zshrc
- Clone the repo
git clone https://github.com/Kevincav/AdventOfCode2024.git
- Change git remote url to avoid accidental pushes to base project
git remote set-url origin Kevincav/AdventOfCode2024 git remote -v # confirm the changes
-
Run the Github Action File Downloader (This action should run at midnight every day from Dec 1st - 25th)
-
Pull the newest version of the code
git pull
- Parse your input into the needed data type for the run and add that to the setup function
- Write the code for solution 1 and add that to the solution1 function
- Write the code for solution 2 and add that to the solution2 function
- Run the days solutions with the example data
sbt 'testOnly *org.advent.year{year}.Day{day}Test'
- Make your changes
git add . git commit -am "I have made some changes."
- Push your commit
git push origin develop
- Check your most recent actions run for details
This repo/tool does follow the automation guidelines on the /r/adventofcode community wiki. Specifically:
- Outbound calls are throttled to every N minutes (defined by environmental variable AOC_SUBMISSION_THROTTLE) in pushAnswer()
- Automated submissions can be turned off by setting the environmental variable AOC_SUBMIT_ANSWERS to false
- Solution inputs are downloaded and committed daily at midnight through GitHub Actions (only December 1-25 every year)
- Once inputs are downloaded, they are cached locally in
src/main/resources
- If you suspect your input is corrupted, you can manually request a fresh copy by running the
input-aoc-solution-data
GitHub Action - The User-Agent header is set through GitHub Action Secrets
- Setup API / REST call to submit answers for the day (instead of manual submissions)
- Setup Rate Limiter for REST submission
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/Kevincav/AdventOfCode2024