My own entries for the Advent of Code event.
Includes a useful CLI tool to automatically fetch puzzle input and execute code.
- Set the
SESSION_COOKIE
variable in a.env
file, using your own session cookie from the AoC website:
# .env
SESSION_COOKIE=abcdefghijklmnopqrstuvwxyz
- Put your own code into one of the files in the
src/days/[year]
folder. The file must export 2 functions of typeAoCPart
, that must be namedpart1
andpart2
, and return either a string or a number as the result.
import { AoCPart } from '../../types';
export const part1: AoCPart = (input) => {
return '[This is the result for part 1!]';
};
export const part2: AoCPart = (input) => {
return '[This is the result for part 2!]';
};
- Run the program from the command line, either using the
dev
script or building and using thestart
script
# Run day 4 of the current year
$ pnpm dev run 4
# or...
$ pnpm build
$ pnpm start run 4
For more information on the available flags and options, use the help
command.