/advent-of-code-template

Primary LanguageTypeScriptMIT LicenseMIT

๐ŸŽ„ Advent of Code Template

  • Bun & TypeScript
  • Automatic day setup
  • Puzzle input automatically fetched
  • Performance metrics

This template is strongly inspired by the template from matijaoe.
Thanks for your inspiration!

Setup

Ensure bun is installed:

bun -v

if not installed, run this:

curl -fsSL https://bun.sh/install | bash

Install dependencies:

bun install

Set up a new day:

bun setup 1

Run day solutions:

bun day 1

For automatic puzzle input retrieval, define .env file with session cookie from adventofcode.com:

SESSION=
YEAR=2023

Structure

Generated day structure:

import { parseLines, readInput } from 'io';

const input = await readInput('day-01');

export const part1 = () => {
	const lines = parseLines(input);
	// TODO: add your code goes here
	return lines.length;
};

bun day <day-num> output:

๐Ÿ•ฏ๏ธ Your result for day <DAY>:
๐ŸŒฒ Part One: 70698 (1.11 ms)
๐ŸŽ„ Part Two: 140471 (383.5 ยตs)

Days

โญ / โŒ

Day Part 1 Part 2 Solution Advent of Code link
01 โญ โŒ Link Day 01
02 Day 02
03 Day 03
04 Day 04
05 Day 05
06 Day 06
07 Day 07
08 Day 08
09 Day 09
10 Day 10
11 Day 11
12 Day 12
13 Day 13
14 Day 14
15 Day 15
16 Day 16
17 Day 17
18 Day 18
19 Day 19
20 Day 20
21 Day 21
22 Day 22
23 Day 23
24 Day 24
25 Day 25