This repository contains my solutions for Advent of Code, an annual coding challenge that runs from December 1st to December 25th.
Advent of Code is a series of programming puzzles released daily during December, created by Eric Wastl. Each day presents two related puzzles that can be solved using any programming language. The puzzles cover various computer science concepts, algorithms, and data structures, becoming progressively more challenging as the month goes on.
Key features:
- One puzzle released each day at midnight EST (UTC-5)
- Each day has two parts, with the second part unlocked after completing the first
- Input data is unique for each participant
- Solutions can be written in any programming language
- Global leaderboard for fastest solutions
- Private leaderboards for friends or organizations
To automatically fetch puzzle inputs, you'll need to set up your Advent of Code session cookie:
- Log in to Advent of Code
- Open your browser's developer tools (usually F12 or right-click -> Inspect)
- Go to the "Application" or "Storage" tab
- Under "Cookies", find the cookie named
session
- Copy the value of this cookie
- Create a
.env
file in the root directory of this project - Add your cookie value:
AOC_COOKIE=your_cookie_value_here
Note: Keep your session cookie private and never commit it to version control.
This project uses just as a command runner. Here are the available commands:
just gen YEAR DAY
This command:
- Creates a new directory for the specified year and day
- Copies the Go template files from
templates/go/
- Downloads the input data using your AOC cookie
- Opens the solution in Windsurf IDE
Example:
just gen 2023 1
just run YEAR DAY
This command:
- Changes to the specified year/day directory
- Runs the Go solution
Example:
just run 2023 1
.
├── YEAR/
│ └── dayN/
│ ├── main.go
│ └── input.txt
├── templates/
│ └── go/
├── utils/
├── .env
├── justfile
└── README.md