Skip to content

Otard95/advent-of-code

Repository files navigation

Advent Of Code

This repo has utils to setup your daily adventure including getting and parsing the task to markdown. It also handles getting the task input and passes it to the main function of each part.

Getting started

Add your AoC session token to a ./.env with the key AOC_SESSION and $ npm install.

Setup your daily adventure with:

npm start setup <year> <day>

Now you should have a directory ./<year>/<day> with three files - README.md, pt1.js and pt2.js The readme has the adventure description the AoC site as Markdown the js files have the template:

/**
 * @param {string} value
 */
const main = async (input) => {
  // Your code here
}

module.exports.main = main

The main function as you can see takes one arg input which if you use the below command will be your adventure input from the AoC site.

npm start <year> <day>

When you think you have the correct answer you can use the submit command. Give the year, day, part and answer and check if you are correct.

npm start submit <year> <day> <part> <answer>

Once you've completed part one you can update the readme

with:

npm start update <year> <day>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published