Advent Of Code - Day 6

Advent Of Code - Day 6 Alright. This time, we are going to learn something that AOC does from time to time… Let’s break it down. Day 6 - Part 1 We start off really easy. We venture around in the sea, looking for nothing but trouble. We have our squid friend with us, whom we were telling everything about vents on the sea floor. Which happen to line up perfectly straight for some weird reason. ...

December 6, 2021 · 8 min · hannibal

Advent Of Code - Day 5

Advent of Code - Day 5 Alright. Today, we are going to learn something that will be useful to us in the coming days. Let’s see what we are dealing with. Edit: An interesting algorithm to read up on is Bresenham’s line algorithm. Day 5 - Part 1 We deal with vents today. The sea is a dangerous place after all. Fortunately for us, these vents line up perfectly so Santa can dodge them easily. We get a bunch of coordinates which form lines basically. The wording is pretty weird, says one end and the other. But these are just begin and end coordinates in a 2D grid. ...

December 5, 2021 · 5 min · hannibal

Advent Of Code - Day 4

Advent of Code - Day 4 Disclaimer: There is surely a better solution than this one. But I’m fairly okay with this one. And I wrote it, so… Okay, this day was a bit more complex now. But not in understanding what needed to be done, but implementing it. And then, part two of course. Day 4 - Part 1 We met a squid this day and decided to play a round of Bingo with it. Because, why not? Bingo is a simple game. You have several papers on which there are a couple numbers in a square. Someone draws a number, and you need to find that number on your boards, cards, slips, whatevers. Once you have marked 5 numbers in a row, or a column ( or, in the original game diagonal also goes ) you win. ...

December 4, 2021 · 5 min · hannibal

Advent Of Code - Day 3

Advent Of Code - Day 3 Here we go for day 3! This day was a tiny bit more complex. A lot of more things to read for sure! But all the more exciting! Let’s get to it! Day 3 - Part 1 We are dealing with binary numbers. At fist glance it can be daunting, but it’s actually not that complicated. We have to find two numbers. gamma rate and epsilon rate. To do that, we have to parse some binary numbers and then convert them to decimal. The two numbers can be found by looking for the most common bit at a given position in all of the numbers and the least common one at a given position in all of the given numbers. Better put, as we read on, find the bit that occurs most of the time and the one that occurs least of the time in all numbers and put them together. That’s your new number. ...

December 3, 2021 · 6 min · hannibal

Advent Of Code - Day 2

Advent Of Code - Day 2 Here we go for day 2! These first couple of problems prepare you on how to deal with input mainly. Learn and get used to parsing lines, and get comfortable with data structures. Day 2 - Part 1 We continue the story of Santa and the submarine. This time, he has the task of trying to steer the thing. The task is straightforward. You get a couple of instructions and based on a value you increase or decrease a positions. ...

December 2, 2021 · 5 min · hannibal

Advent Of Code - Day 1

Advent Of Code - Day 1 Since 2015, Advent Of Code has been a part of my life. I’ve done various posts on it already, but this year will be different. I’m going to blog every day every solution, why and how I’ve gotten to that solution. This isn’t going to be ever December, because I’m usually unable to solve a problem on a single day in the later days from day 10 or so. It takes more time then I have. But I will solve all of them. At the time of this writing, I have completed almost all puzzles except for year 2019 which I didn’t much enjoy to be honest. ...

December 1, 2021 · 7 min · hannibal