A powerful and flexible setup for solving Advent of Code puzzles with Deno. This toolkit helps you scaffold, download, and solve puzzles with ease. π§©
- Automatic Scaffolding: Generate boilerplate code for new days. π οΈ
- Puzzle Download: Fetch inputs and puzzles directly from Advent of Code with the
aoc
CLI. π¦ - Task Runner: Manage development tasks using Deno's
task
feature. β - TypeScript Support: Write clean, type-safe solutions. π
- Install Deno.
- Install the
aoc
CLI tool (documentation). - Create a session cookie file at
~/.adventofcode.session
for fetching inputs.
This project uses deno task
to simplify common workflows:
scaffold <day>
: Create boilerplate files for a given day.download <day>
: Download input and puzzle files for a specific day.solve <day>
: Run the solution for a specific day.
# Scaffold a new day
deno task scaffold 1
# Download inputs for day 1
deno task download 1
# Solve puzzles for day 1
deno task solve 1
# Run tests on example data for day 1
deno task test 1
βββ days/ # Solutions for each day
β βββ day01.ts # Day 1 solution
β βββ day02.ts # Day 2 solution
β βββ ...
βββ data/ # Input and example data
β βββ inputs/ # Puzzle inputs
β βββ examples/ # Example inputs
β βββ puzzles/ # Puzzle descriptions
βββ scripts/ # Helper scripts
β βββ scaffold.ts # Scaffolding script
β βββ download.ts # Download script
β βββ solve.ts # Solve script
β βββ _template.ts # Template for scaffolding
βββ deno.json # Deno configuration
- Use
scaffold
to create a solution template for a specific day. - Use
download
to fetch inputs and puzzles. - Write and test your solutions in the generated files.
- Use
solve
to run and verify your answers. - Use
test
to run tests on example data for a specific day.
Made with β€οΈ by @magnusrodseth