Skip to content
/ AoC-template Public template

πŸ’» πŸ“ƒ Template to generate environment for solving Advent of Code

Notifications You must be signed in to change notification settings

pagyew/AoC-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AoC-template

Use this template to generate environment for solving Advent of Code 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

Utils

  • 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');

link to original repository

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

About

πŸ’» πŸ“ƒ Template to generate environment for solving Advent of Code

Topics

Resources

Stars

Watchers

Forks