Use this template to generate environment for solving Advent of Code puzzles
- Create
.envfile in the root of the project to store your session cookie and year - Add
AOC_SESSION=YOUR_SESSIONto your.envfile - Add
AOC_YEAR=YEAR_YOU_WANT_TO_SOLVEto your.envfile
You can run the script using the command node go [next|last]
nextwill create a new directory for the next day and open the filelastwill 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
heapβ Used for priority queue.
const Heap = require('../../utils/heap');
const heap = new Heap(compareFunction, initialArray);
nerdamerβ Used for solving equations.
const nerdamer = require('../../utils/nerdamer');
- In
[day].txtyou can find the input for the problem - Dirname and input filename for the day less than 10 should be prefixed with
0for 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