Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zacowan/aoc-2024
My solutions for Advent of Code 2024.
https://github.com/zacowan/aoc-2024
advent-of-code advent-of-code-2024 typescript
Last synced: about 1 month ago
JSON representation
My solutions for Advent of Code 2024.
- Host: GitHub
- URL: https://github.com/zacowan/aoc-2024
- Owner: zacowan
- Created: 2024-12-02T22:17:45.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-02T22:36:24.000Z (about 1 month ago)
- Last Synced: 2024-12-02T23:28:13.561Z (about 1 month ago)
- Topics: advent-of-code, advent-of-code-2024, typescript
- Language: TypeScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π 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](https://github.com/fspoettel/advent-of-code-rust).Solutions for [Advent of Code](https://adventofcode.com/).
## Setup
1. Install [Fast Node Manager](https://github.com/Schniz/fnm) or [Node Version Manager](https://github.com/nvm-sh/nvm).
2. Use the right version of Node:```sh
fnm use
# or
nvm use
```3. Install [pnpm](https://pnpm.io).
4. Install required dependencies:```sh
pnpm i
```5. β You're ready to go!
## Usage
This project comes with scripts to make problem-solving fun.
### Scaffold a day
```sh
# example: `pnpm scaffold 1`
pnpm scaffold# 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
```sh
# example: `pnpm solve 01`
pnpm solve# 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
```sh
pnpm test
```This just runs [vitest](https://vitest.dev) under-the-hood and supports all of the same CLI options at the vitest CLI.
### Lint code
```sh
pnpm lint
```### Typecheck code
```sh
pnpm typecheck
```