Advent of Code - RocketLang Edition

This years Advent of Code is a little special because I use my own language RocketLang to solve the puzzles. I’ll probably explain this in a seperate post at some point so lets have a look at the first puzzle of the year: Problem The task is to calculate the amount of calories they are carrying. For example: 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 This shows us 5 elves with different amount of items (with different calories each)....

December 1, 2022 · 2 min · 394 words · Robert

Advent of Code Day #6

Day 6 is again pretty nice to solve with Ruby. Today it is all about customs declaration. We again have different groups seperated by a newline containing multiple lines with characters. Each line represents a person and each character represents a different question answered with “yes”. abc a b c ab ac a a a a In this example we do have four groups of people. The first group only has one person which answered three questions....

December 6, 2020 · 2 min · 328 words · Robert

Advent of Code Day #5

Day five is all about the airplane seating. One seat it represented by something like this: FBFBBFFRLR. The first eight characters are for the row, the last three for the seat. Part 1 We need to find the highest seat id to solve the first part. The seat id is calculated with: row-id * 8 + column. For the rows you start with a range of 0 to 127. F means use the first half B means use the last half With this in mind you need to iterate over the first eight characters to get your seat....

December 5, 2020 · 2 min · 263 words · Robert

Advent of Code Day #4

In day 4 we need to deal with passports (yay!) and check if they are valid for given criterias. The passworts do have multiple fields (key:value) and are divided by a newline. ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm The fields are given and expected like so: byr (Birth Year) iyr (Issue Year) eyr (Expiration Year) hgt (Height) hcl (Hair Color) ecl (Eye Color) pid (Passport ID) cid (Country ID) Splitting them into “passports” is as easy as it gets....

December 4, 2020 · 2 min · 255 words · Robert

Advent of Code Day #3

In day 3 you have a ever repeating map with trees and free spaces. You move over this map and have to count how many trees (#) you will hit. Part 1 Given is a pattern in which you move right and down. In part 1 we start in the top left corner and always move 3 right and one down until we reach the last line. ..##.........##.........##.........##.........##.........##....... ---> #...#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#.. ....

December 3, 2020 · 2 min · 282 words · Robert