Welcome to my Advent of Code 2024 repository! Built with TypeScript and grounded in functional programming.
This project uses Bun, a fast JavaScript runtime ideal for Advent of Code:
- Tail Call Optimization (TCO): Enables deep recursion without stack overflow.
- High Performance: Optimized JIT for complex Advent of Code computations.
- Built-In Test Runner: Allows easy test setup and validation of solutions.
- Native TypeScript Support: Type-safe coding without extra compilation.
For more, visit Bun's website.
-
Clone the Repository:
git clone https://github.com/andrewbrennanfr/advent-of-code-2024.git cd advent-of-code-2024
-
Install Dependencies:
bun install
-
Set Up Git Hooks (using Husky):
bun husky
bun check
β TypeScript type-checking.bun format
β Code formatting with Prettier.bun lint
β Linting with ESLint.bun new NN
β Creates a new puzzle directory and starts tests.bun start
β Runs all tests in watch mode.bun start NN
β Runs tests in directoryNN
in watch mode.bun test
β Runs all tests once.bun test NN
β Runs tests in directoryNN
once.
Emphasizes pure functions, recursion, and higher-order functions for clear, maintainable solutions.
To reduce side effects, data is kept immutable by default, with mutations allowed only for Map
and Set
instances named with a mutable
prefix (e.g., mutableMap
, mutableSet
).
β οΈ Note: Use mutable collections with caution due to potential side effects.
Puzzle input files are excluded from version control per Advent of Code's guidelines.
Licensed under the MIT License.
π Happy solving!