This repository includes my personal solution framework for the Advent of Code challenges. Capabilities include:
- Automatic setup - creates files for challenges and input data
- Easy submission - submit solutions directly from the command line
Important
Be sure Deno is installed before proceeding. If not, follow the steps in the provided guide.
-
Clone the repository
git clone https://github.com/lewxdev/advent-of-code.git cd advent-of-code
-
Create a
.env
fileecho "AOC_SESSION=your_session_id" > .env
Replace
your_session_id
with the session cookie found on the Advent of Code website. You can find this by authenticating in a browser and copying the value of thesession
cookie from the developer tools.
-
Run the setup script
deno run dev
This will prompt you to enter the event year and day, and create the necessary files.
-
Run the dev script
deno run dev path/to/solution
This will run the script in watch mode and prompt you to submit when the solution changes. Alternatively, you can open the script in Visual Studio Code and run the
deno: dev
task from the command palette.
Important
When providing a filepath, be sure the path is a valid import path (e.g.
relative to the project root: ./2020/01/main.ts
or an absolute path:
/home/user/projects/advent-of-code/2020/01/main.ts
). An error will be thrown
if the path is invalid.