Solutions for Advent of Code 2021 in Typescript with a custom React calendar.
Includes a web app and a console runner. Check out the web app at https://sanraith.github.io/aoc2021
Run git clone https://github.com/sanraith/aoc2021
to clone the repository.
Run npm install
to download dependencies.
Run npm run web
to run the React web app locally.
Run npm start
to solve all days.
Run npm start -- --day 2 3
to solve day 2 and 3.
Run npm start -- --last
to solve the last available day.
Run npm start -- --help
to display all available options.
Visual Studio Code configuration is set up to attach to the latest solution on debug.
You can also run npm run dev
to start a nodemon process for the latest solution.
This project only contacts adventofcode.com when you
issue one of the below commands. It makes exactly 1 request for the description and input
as one would do manually within a browser.
Provide your session key in util/session.json
if you want to fetch the puzzle title and input.
{
"sessionKey": "YOUR_SESSION_KEY_HERE"
}
Run npm run scaffold
to scaffold code for the next available day.
Run npm run scaffold -- 11
to scaffold code for the day 11.
Run npm run scaffold -- 2 3 4 --year 2019
to scaffold code for the day 2, 3 and 4 from year 2019.
Run npm run scaffold -- --help
to display all available options.