make new YEAR=2021 DAY=1
This creates the day structure and adds the import to main.go
.
go run . -year 2021 -day 1 # Run with actual input
go run . -year 2021 -day 1 -example # Run with example input
Input files go in input/YEAR/DAY/actual.txt
and input/YEAR/DAY/example.txt
.
To automatically download inputs, create a .env
file with your session cookie:
- Log in to adventofcode.com
- Open dev tools (F12) → Application/Storage → Cookies
- Copy the
session
cookie value - Add to
.env
:AOC_SESSION_COOKIE=your_cookie_here