Skip to content

zacowan/aoc-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f193a54 Â· Jan 25, 2025

History

25 Commits
Dec 2, 2024
Dec 7, 2024
Dec 3, 2024
Dec 11, 2024
Dec 2, 2024
Dec 2, 2024
Dec 2, 2024
Dec 2, 2024
Dec 2, 2024
Dec 2, 2024
Jan 22, 2025
Dec 2, 2024
Dec 2, 2024
Dec 2, 2024

Repository files navigation

🎄 Advent of Code 2024

Note

This repo is inspired by Felix Spöttel's excellent Rust template that I used last year - you can find that here.

Solutions for Advent of Code.

Setup

  1. Install Fast Node Manager or Node Version Manager.
  2. Use the right version of Node:
fnm use
# or
nvm use
  1. Install pnpm.
  2. Install required dependencies:
pnpm i
  1. ✅ You're ready to go!

Usage

This project comes with scripts to make problem-solving fun.

Scaffold a day

# example: `pnpm scaffold 1`
pnpm scaffold <day>

# output:
# Created empty example file "data/examples/01.txt"
# Created empty input file "data/inputs/01.txt"
# Created test file "src/solutions/01/01.test.ts"
# Created solution file "src/solutions/01/01.ts"
# ---
# 🎄 Type `pnpm solve 1` to run your solution.

Individual solutions live in the ./src/solutions/ directory as separate files. Inputs and examples live in the the ./data directory.

Every solution has tests referencing its example file in ./data/examples. Use these tests to develop and debug your solutions against the example input.

Run solutions for a day

# example: `pnpm solve 01`
pnpm solve <day>

# output:
# Part One: 42
# Part Two: 42

The solve command runs your solution against real puzzle inputs from the ./data/inputs directory.

Run all tests

pnpm test

This just runs vitest under-the-hood and supports all of the same CLI options at the vitest CLI.

Lint code

pnpm lint

Typecheck code

pnpm typecheck