devries / advent_of_code_2020

Advent of Code 2020 in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code 2020

Tests Go Report Card stars: 50

Summary

Another year of Advent of Code is over, and as usual it provided a daily dose of fun in the countdown to Christmas. This year I needed something like it more than most, as I think we all did. This was also the first year that my daughter and I worked on problems together. She is just learning how to write code in a high school class, so many of the concepts are very new to her, but I enjoyed helping her and talking through the problems. Unfortunately as her midterms started, she didn't have a lot of time to work on Advent of Code, but we hopefully will be going back to look at some of the more interesting problems.

I really enjoyed the Intcode problems from 2019 and missed having something we were building over time this year. I also thought there were some extremely challenging problems last year, which at times made it pretty difficult to keep up, but this year seemed to have fewer very difficut problems. The final weekend of Advent of Code (days 19 and 20) were problems I thought were the most difficult, but this year I was able to mainly work on the problems before starting work each morning.

This year I tried to write more tests to get into a better habit of using tests, and that mostly worked out, except for day 19. Day 19 gave me the most trouble. I got the first part fairly quickly, but I had a bug in my code which manifested itself in the second part. It took a long time to debug the issue, and in that time I managed to introduce several more bugs. I also had an error in my tests, which may have led me to keep trying to debug the problem after it was working. I had to do a lot of cooking that night and decided I would rewrite part 2 entirely after dinner. I then was able to find my mistakes and finish the problem. In the end nearly 8 hours elapsed between the time I finished part 1 and finished part 2.

I thought day 20 was a lot of fun, and I managed to get through this one with few bugs, even though it took some time. I enjoyed considering all the orientations as well as the rotations or flips required to go between them. I also enjoyed day 10 quite a bit. Juggling all those joltage adapters and figuring out the total number of possible adapter combinations to charge your handheld.

I thought the hexagonal grid was pretty interesting, and I suspected most people would use the same coordinate system I used (east and west are given by 2 moves along the X-axis, whereas northeast, northwest, southeast, and southwest would be given by 1 move in the X-axis and 1 move in the Y-axis), however I was surprised that many people just tilted the Y-axis to align with either the northeast or northwest direction, and treated east and west as one step in the X-axis, northwest and southeast as 1 step in the Y direction, and northeast and southwest as one step in each of the X and Y axes.

Even though this is only my second year, I feel like this event really starts to put me in the Christmas mood, and I look forward to next year.

Index

About

Advent of Code 2020 in Go


Languages

Language:Go 94.6%Language:Python 4.4%Language:Shell 1.0%