https://adventofcode.com/2023 by Eric Wastl
Solutions using TypeScript \w Deno v1.38
Go to the folder of the desired day
cd 01
Run part A or B, while allowing all permissions
deno run --allow-read a.ts
OR
deno run --allow-read [daynumber]/[part].ts
For example: deno run --allow-read 01/a.ts
cd 01
deno test .
Debugging in Visual Studio Code
-
Open the desired file in the editor
-
Set breakpoints
-
Press F5
- [Trebuchet?!] Checking strings for first and last appearances of substrings
- [Cube Conundrum] Bag & cube game, parsing input lines by extracting numbers
- [Gear Ratios] Parsing a giant grid with multi column numbers
- [Scratchcards] Lidl recursion on scratchcard winnings
- [If You Give A Seed A Fertilizer] Collapsing multiple ranges of very large numbers
- [Wait For It] Quick maths with quadratic formula
- [Camel Cards] Poker with joker cards
- [Haunted Wasteland] Simultaneous node traversal with LCM
- [Mirage Maintenance] Predicting next value of number sequence via extrapolation
- [Pipe Maze] Grid problem with multiple connected pipes creating a single continuous loop. Using a parity counter to keep track of passed walls to calculate area inside the loop.
- [Cosmic Expansion] Calculating distances of all combinations of items in an expanding grid.
- [Hot Springs] Generating and validating arrangements of strings with joker characters
- [Point of Incidence] Finding lines between columns and rows on grids to fold over and create a mirror image
- [Parabolic Reflector Dish] Rolling balls NESW on a tilting grid, cycle detection to prevent doing this a literal billion times.
- [Lens Library] Creating a simple hashing function & some simple array operations (Did day 5 and 15 get swapped..?)
- [The Floor Will Be Lava] Manouvering a light beam through a grid of lasers with offset mirrors, tricky rotations.
- [Clumsy Crucible] Modified Dijkstra's algorithm with a twist: maximum of 3 steps in the same direction then a required 90 degree turn. Using a heap as priority queue to get candidates for the next node based on weight.
- [Lavaduct Lagoon] Calculating area of polynomal by first generating points on a grid followed by use of shoelace formula and Pick's theorem to find whole integer points inside the trench. Finally adding the whole trench points to said number to get our solution.
- [Aplenty] Day 5 all over again: finding valid ranges of very large ints
- [Pulse Propagation] Mini electronic machine with low/high pulses and boolean operations, cycle detection like day 14.
- [Step Counter] Counting reachable positions in an infinitely repeating grid, using lagrange interpolation to predict values very far away.
- [Sand Slabs] Falling jenga block simulation (without tilting physics)
- [A Long Walk] Finding longest possible path start-end in a maze-like grid
- [Never Tell Me The Odds] Calculating intersections between multiple linear equations (a) and creating an intersecting line in 3D out of thin air (b).
- [Snowverload] Splitting up a graph of nodes by cutting 3 connections.
Notes:
- Day 12 rewritten in Go (1.3 ms / 44 ms [32 ms with goroutines]) vs Deno (34 ms / 270 ms)
- Day 14 rewritten in Rust (0.716 ms / 10 ms) vs Deno (20 ms / 763 ms)