2020-02-13 11:38:35 -05:00
2020-08-01 23:43:57 -04:00
2020-08-02 00:48:54 -04:00
2020-08-02 17:25:33 -04:00
2020-08-03 16:22:34 -04:00
2020-08-03 20:04:23 -04:00
2020-08-04 11:51:36 -04:00
2020-08-04 11:50:35 -04:00
2020-08-04 14:43:56 -04:00
2020-02-13 11:38:35 -05:00
2020-02-13 11:38:35 -05:00
2020-02-13 11:38:35 -05:00
2020-02-13 11:38:35 -05:00
2020-02-13 11:38:35 -05:00

Advent of Code 2019

Language: GoLang. https://adventofcode.com/2019


Summary of Days

Day Name Type of Algo & Notes
1 The Tyranny of the Rocket Equation - Simple math problem
2 Program Alarm - Intro to the crazy Intcode problems that are half the AoC days...
- Array (slice...) manipulation
- I used recursion
3 Crossed Wires - Geometry kind of algo, finding intersections of lines on a grid
4 Secure Container - May appear math-y, but it's really a string manipulation problem
5 Sunny with a Chance of Asteroids - Yay more Intcode!........
- This gave me fits...
- Good application for recursion (in my opinion)
6 Universal Orbit Map - Tree traversal and depth calculations. It's not quite a Graph, but it has a directed graph algo feel too
7 Amplification Circuit - More Intcode... Piping together multiple Intcode computers 😳😳😳
- Refactored Intcode computer to an OOP approach so a single computer maintains its data
- Also requires making permutations generator
- Some gymnastics to make this circular, but its easier with this OOP approach and the "objects"/instances of a struct maintaining their own data
- Concurrency could be used to sync these Amps together...
8 Space Image Format 3D Array manipulation, pretty straight forward
9 Sensor Boost MORE INTCODE. YAYY 🙃
- A new parameter mode and opcode.
- Really feeling the (tech) debt of some earlier design choices here, went back to refactor day07 before jumping into this one, then it was a small bit of code for the relative param/opcode & resizing computer memory if necessary
10 Monitoring Station - This (part2) is my favorite algo... Yes I have a favorite algo
Fundamentally it's a geometry problem, angles and trig
- Part 1: Calculated via slopes
- Part 2: Using Arctangent to find angles an asteroid makes against a vertical line from the home base asteroid. Then those angles can be used to determine if Asteroids are covering each other, AND iterating through all of them can find the next angle Asteroid to vaporize
11 Space Police - More Intcode stuff...
- 2D Array/Slice manipulation and a bit of maths/graphing
- Implemented a RotateGrid algo
12 The N-Body Problem I like to call this a (harmonic) frequency algo. Finding the harmonic frequency of multiple bodies/items and then finding the Least Common Multiple of those frequencies will tell you when all the bodies have returned to their initial state.
- I've used this approach for a leetcode problem about prisoners in jail cells too
13 Care Package Intcode again! It's basically every other day...
- part1: 2D array manipulation again
- part2: holy algo, some logic to basically play Bricks game.
- This is more of a design question for how you manage state
14 Space Stoichiometry Weighted Graph and Breadth First Traversals
- Because not all of the products have a quantity of 1, it complicates the graph's data model. I ended up mapping the product/chemical name to a map of its stoichiometry where the product's number is positive & reactants were negative.
- part2: not just a simple division because of "extra byproducts" of generating each piece of fuel. I just let this brute force thing run for ~30 seconds...
S
Description
(All 7 years of) adventofcode.com solutions in Go
Readme 1.5 MiB
Languages
Go 79.6%
Python 20%
Makefile 0.4%