Skip to content

mfulton26/adventofcode

Repository files navigation

adventofcode

My Advent of Code solutions.

Browser usage

Run the following in the DevTools Console while on a puzzle page (e.g. Day 1 - Advent of Code 2015):

Part one and two can be solved for a puzzle by importing the solve.js module.

await import("http://localhost:8000/solver.js").then(({ solve }) => solve());

A part option can be specified to only solve part 1 or 2.

await import("http://localhost:8000/solver.js")
  .then(({ solve }) => solve({ part: 2 }));

A dotLetterParsing option is also available to disable detection and parsing of dot-letter answers.

await import("http://localhost:8000/solver.js")
  .then(({ solve }) => solve({ dotLetterParsing: false }));

Command line usage

The below steps currently require solve modules to be available locally.

deno run https://mfulton26.github.io/adventofcode/bin/aoc.ts solve 2021/day/1
deno install --allow-env=AOC_BASE_URL,AOC_CACHE_DIR,AOC_CONFIG_DIR,AOC_SESSION,HOME --allow-read=$HOME/.aoc,.. --allow-write=$HOME/.aoc --allow-net=adventofcode.com,deno.land,esm.sh --allow-hrtime --import-map=./importMap.json ./bin/aoc.ts
% aoc solve 2021/day/1
running solve from ./2021/day/1/part/1/solve.ts
1298 (559µs)
running solve from ./2021/day/1/part/2/solve.ts
1248 (404µs)

2 solved (79ms)

About

Advent of Code Solvers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published