Joel Eisner's completed TypeScript x Bun code challenges for "Advent of Code" 2023.
git clone git@github.com:joeleisner/advent-of-code-2023.git
cd advent-of-code-2023
bun install --production
bun run days
Use GitHub Codespaces in your browser or Visual Studio Code Dev Containers leveraging Docker to get up and running with zero configuration.
Each day can be found under the days
directory and is roughly structured identically to other days in the project. Here are files to look out for:
bench.ts
- Where the logic is benchmarked. This script is called when runningbun run bench <number>
.index.ts
- Where the logic is ran. This script is ran when runningbun run days <number>
.input_test.txt
orinput_test.*.txt
- Example inputs usually pulled directly from the AoC website and used while testing.input.txt
- The actual, personalized input from the AoC website.mod_test.ts
- Where the logic is tested. This script is called when runningbun test days/<number>
.mod.ts
- Where the logic lives. This usually includes 2 functions for each part of the code challenge, along with other functions and helpers.readme.md
- Day-specific instructions on how to run, test, and benchmark the code.
Shared code can be found under the lib
directory, which includes useful utilities for grids, math, and matrices. The scripts
directory contains the code for creating, running, and benchmarking any day in the project.
# Run all completed code challenges
bun run days
# Run all but some completed code challenges
bun run days 1! 2! 3!
# Run a set of completed code challenges
bun run days 1 2 3
bun run days 01 02 03
# Run a specific completed code challenge
bun run days 1
bun run days 01
bun run days 2
bun run days 02
bun run days 3
bun run days 03
# ...
# Test all completed code challenges
bun test days
# Test a specifc completed code challenge
bun test days/01
bun test days/02
bun test days/03
# ...
# Test each library
bun test lib
# Test all code
bun test
# Benchmark all completed code challenges
bun run bench
# Benchmark all but some completed code challenges
bun run bench 1! 2! 3!
# Benchmark a set of completed code challenge
bun run bench 1 2 3
bun run bench 01 02 03
# Benchmark a specific completed code challenge
bun run bench 1
bun run bench 01
bun run bench 2
bun run bench 02
bun run bench 3
bun run bench 03
# ...