This repository has some boilerplate, utils and setup for running Advent of Code easily.
Log in on advent of code, and copy the session
cookie to your the SESSION
env var.
Now run nvm use
and yarn install
.
To fetch inputs for a given day, run yarn setup [day]
, e.g. yarn setup 1
.
If run without a day, it'll fetch all days up to now.
By default, yarn start
runs yarn typescript
- change this if you want.
This will run tests (if provided), execute your code, and send the solution. Solutions will be deduped before sending.
Typescript has some special utils in the utils
folder. There are:
.last
as an extension method on Array. Let's be honest, it should always have been there.printGrid(grid: string[][])
to display a grid.visualisePoints(points: Record<string, Point[]>)
: creates a visual grid with marks at the specified points.- For example:
visualisePoints({a: [0, 0], b: [0, 1]})
printsab
- For example:
aStar
is the A* algorithm