Skip to content

My (very πŸ€ͺ) opinionated TypeScript repository for Advent of Code 2024!

Notifications You must be signed in to change notification settings

andrewbrennanfr/advent-of-code-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ„ Advent of Code 2024 πŸŽ„

Welcome to my Advent of Code 2024 repository! Built with TypeScript and grounded in functional programming.


⚑ Why Bun?

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.

πŸ“¦ Getting Started

  1. Clone the Repository:

    git clone https://github.com/andrewbrennanfr/advent-of-code-2024.git
    cd advent-of-code-2024
  2. Install Dependencies:

    bun install
  3. Set Up Git Hooks (using Husky):

    bun husky

πŸš€ Key Scripts

  • 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 directory NN in watch mode.
  • bun test – Runs all tests once.
  • bun test NN – Runs tests in directory NN once.

🧠 Project Philosophy

Functional Programming

Emphasizes pure functions, recursion, and higher-order functions for clear, maintainable solutions.

Immutability

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 Inputs

Puzzle input files are excluded from version control per Advent of Code's guidelines.


πŸ“œ License

Licensed under the MIT License.


πŸŽ… Happy solving!