Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goosewin/aoc2024
🎄 My solutions and TypeScript project template for Advent of Code 2024!
https://github.com/goosewin/aoc2024
advent-of-code advent-of-code-2024 advent-of-code-2024-typescript algorithm-challenges aoc aoc-2024 aoc-2024-in-typescript bun bunjs programming-challenges programming-puzzles ts typescript
Last synced: 15 days ago
JSON representation
🎄 My solutions and TypeScript project template for Advent of Code 2024!
- Host: GitHub
- URL: https://github.com/goosewin/aoc2024
- Owner: goosewin
- License: mit
- Created: 2024-12-02T03:42:02.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-20T04:51:48.000Z (about 2 months ago)
- Last Synced: 2025-01-28T21:36:19.668Z (17 days ago)
- Topics: advent-of-code, advent-of-code-2024, advent-of-code-2024-typescript, algorithm-challenges, aoc, aoc-2024, aoc-2024-in-typescript, bun, bunjs, programming-challenges, programming-puzzles, ts, typescript
- Language: TypeScript
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-advent-of-code - goosewin/aoc2024
README
# Advent of Code 2024 Solutions
Solutions runner for Advent of Code 2024 puzzles, built with Typescript and Bun.
## Prerequisites
- [Bun](https://bun.sh)
- [Node.js](https://nodejs.org) 18+## Setup
1. Clone this repository
2. Install dependencies:```shell
bun install
```## Project Structure
```
.
├── src/
│ ├── XX-solution.ts # Daily solution files (XX = day number)
│ ├── XX-input # Daily input files
│ ├── XX-problem.md # Problem descriptions
│ └── common.ts # Shared utilities
├── index.ts # CLI runner
└── package.json
```## Usage
### Run solution for a specific day
```shell
# Run both parts for a day
bun start 1# Run a specific part
bun start 1 --part 1
bun start 1 -p 2
```### Run all solutions
```shell
bun start
```## Solution Format
Each daily solution should be placed in the `src` directory following the naming convention `XX-solution.ts` (where XX is the zero-padded day number). Solutions use the `withTiming` wrapper to automatically measure and display execution time.
Example solution file (`01-solution.ts`):
```ts
import { readInput, withTiming } from "./common";export const part1 = async () => withTiming(async () => {
const input = await readInput("01");
// Solution implementation
return result;
});export const part2 = async () => withTiming(async () => {
const input = await readInput("01");
// Solution implementation
return result;
});
```## Features
- 🚀 Fast execution with Bun runtime
- 📊 Automatic performance timing for solutions
- 🎯 Run specific parts or days
- 🔄 Automatic input file loading
- 💪 TypeScript support
- 📝 Common utilities for parsing and timing## License
MIT