Advent of Code 2019 - Day 10

Advent of Code 2019 - Day 10 Find my full solution repo here I enjoyed this puzzle quite a bit. I’m also happy that my arctangent skills are fresh thanks to some Unity3d tutorials I worked through a couple months ago. I started off by creating a 2d list representing the board and then logged all the asteroid positions. This made it easier to iterate through asteroids later since I wouldn’t have to find them first....

2019-12-24 · Me

Advent of Code 2019 - Day 9

Advent of Code 2019 - Day 9 Find my full solution repo here Debugging this puzzle was a complete nightmare for me. As is the case with most debugging stories, it was completely my fault all along. The Problem First, a while back, I thought that the instructions said “a parameter that you write to will always be in immediate mode.” The instructions actually say the exact opposite of that. So, when processing the parameter modes, I would hardcode the parameter mode to “immediate” for arguments that were supposed to be written to....

2019-12-24 · Me

Advent of Code 2019 - Day 8

Advent of Code 2019 - Day 8 Intro Day 8 was a refreshing break from the Intcode vm and it was exactly what I like out of programming puzzles: simple premise, straightforward, and short implementation time once you’ve devised a valid approach. As always, you can find my full solutions repo here. Solution For part one, I worked with a list of lists, with each inner list as a “layer” of data....

2019-12-22 · Me

Advent of Code 2019 - Day 7

Advent of Code 2019 - Day 7 Intro Day 7 brings another Intcode puzzle, so I finally bit the bullet and refactored my vm. I’m writing this after reading the prompt for day 9, so I’m getting the sense more refactoring might be coming soon. For now, let’s cover day 7’s solution. As always, you can find my full solutions repo here. Solution The main thing I’ve done to refactor my Intcode vm is to encapsulate it inside a class....

2019-12-22 · Me

Advent of Code 2019 - Day 6

Advent of Code 2019 - Day 6 Intro I just finished day 6 right before (checks watch) the day 16 puzzle comes out. Who’s counting? As always, you can find my full solutions repo here. Solution I knew that this was a tree problem but wanted to avoid building one for as long as I could. I solved the first part of the puzzle by with only a sorted list of orbit pairs....

2019-12-15 · Me

Advent of Code 2019 - Day 5

Advent of Code 2019 - Day 5 Intro Day 5 required some additions to my Intcode computer - namely jumping and comparison operators. The puzzle also required me to implement support for parameter and immediate modes depending on the values left of the raw opcode. Let’s get to it! As always, you can find my full solutions repo here. Solution The first step in extending capability is to support parameter and immediate modes for arguments....

2019-12-10 · Me

Advent of Code 2019 - Day 4

Advent of Code 2019 - Day 4 Intro This one wasn’t too bad, so I’m gonna get right to it. You can find my full solutions repo here. Solution The three components of this puzzle aren’t too bad. To find whether a number has adjacent digits that are the same, you can simply pull the last digit and loop your way through the number using modulo (testing for equality at each step)....

2019-12-09 · Me

Advent of Code 2019 - Day 3

Advent of Code 2019 - Day 3 Intro First things first, I stopped using Go and started using Python. You can find my new solutions repo here. I decided to stop using Go because I am also working through SICP in addition to Advent of Code and a stealthmode side project I’m working on. That’s all in addition to my fulltime job, so something had to give and I’m dropping Go for now....

2019-12-09 · Me

Advent of Code 2019 - Day 2

Advent of Code 2019 - Day 2 Intro This puzzle was a clever way of introducing the idea of opcodes, loading/storing values, and assembly in general to someone that may not have been exposed to it before. I watched a talk by the creator of Advent of Code this weekend and he made a point that he has to design these puzzles for someone that may never have taken a CS class before....

2019-12-03 · Me

Advent of Code 2019 - Day 1

Advent of Code 2019 - Day 1 Background Advent of Code is an awesome annual event where people around the world practice their programming chops by solving fun puzzles. I used last year’s AoC to learn JavaScript and I had a great experience (even though I didn’t finish!). This year I’m using AoC as an opportunity to learn Go! I’m working through Learn Go with Tests to learn the concepts and applying them by solving AoC’s daily puzzle....

2019-12-03 · Me