Advent of Code Solutions by Domen Gabrovšek
This repository contains my personal solutions for the Advent of Code, an annual set of Christmas-themed programming challenges. Each folder within this repository corresponds to a different year, with subfolders for each day's challenge.
This table provides a quick glance at my journey through the Advent of Code over the years, highlighting the number of challenges completed each year.
/ | ||
This repository contains solutions for the Advent of Code challenges, written in JavaScript/TypeScript. To get started, you'll need Node.js installed on your system as we heavily rely on it for running scripts and managing dependencies.
// Install dependencies
~ npm install
// Initialize a template source file for the specified year
~ npm run setup [year] // e.g., npm run setup 2023
// Run the solution for a specific year and day
~ npm run start [year] [day] // e.g., npm run start 2022 1
The inputs and instructions for each challenge are automatically fetched from the Advent of Code (AoC) API. This streamlines the process, allowing you to focus on solving the puzzles without the hassle of manual data handling.
Before running the solutions, you need to create a .env
file in the root directory. This file should contain your AoC session token, which is necessary for fetching challenge data from the AoC API.
Example of .env
file content:
TOKEN=your_aoc_session_token_here
You can obtain your AoC session token by inspecting your browser cookies while logged into the AoC website. This token is essential for accessing the AoC API and retrieving puzzle inputs.