Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pagyew/aoc-template
💻 📃 Template to generate environment for solving Adventure of Code
https://github.com/pagyew/aoc-template
aoc
Last synced: 22 days ago
JSON representation
💻 📃 Template to generate environment for solving Adventure of Code
- Host: GitHub
- URL: https://github.com/pagyew/aoc-template
- Owner: pagyew
- Created: 2024-12-01T12:43:36.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-01T19:16:30.000Z (about 1 month ago)
- Last Synced: 2024-12-01T20:23:07.706Z (about 1 month ago)
- Topics: aoc
- Language: JavaScript
- Homepage: https://adventofcode.com
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AoC-template
Use this template to generate environment for solving [Advent of Code](https://adventofcode.com/) puzzles## How to use
### Setup
1. Create `.env` file in the root of the project to store your session cookie and year
2. Add `AOC_SESSION=YOUR_SESSION` to your `.env` file
3. Add `AOC_YEAR=YEAR_YOU_WANT_TO_SOLVE` to your `.env` file### Running
You can run the script using the command `node go [next|last]`
- `next` will create a new directory for the next day and open the file
- `last` will open the last day's file
- Write your solve function in `solve.js` (it's open automatically when you run the script) and return answer### Debugging
- In `[day].txt` you can find the input for the problem
- Dirname and input filename for the day less than 10 should be prefixed with `0` for right alignment
- To debug and view results when solving the problem, you can use `nodemon days/[day]`
- You can also use `node days/[day]` to run the code without the need to restart the server