July 5, 2025

Advent of Slowed Update

I finished Parts 1 and 2 of Day 15, and I’ve managed parts 1 of Days 16 and 17. For each of the unfinished part 2s, I know roughly what I solution should involve, but I’m struggling to get there. The goal of this exercise has always been to learn more about rust and to get some practice using it. I have definitely done that: day 15, in particular, involved writing two impls of a trait I created, one for each part. Thinking about what should be in the impls for the structs, and what should be in the trait, as well as what I can provide default implementations for, was a really interesting exercise. Read more

May 8, 2025

Advent of Slowed Days 13 and 14

My deadline for finishing Day 14 of last year’s advent of code is the 20th, but I have, in fact, already finished it. I am not just scraping by now, I am smashing these deadlines. This probably has more to do with nobody in my household being poorly this week rather than any other factors. In fact, between finishing Day 13 and starting Day 14, I even had some time to go back and look at making some efficiency improvements to some slow tests. Read more

April 25, 2025

Advent of Slowed Days 11, 12, and some refactoring

So we’re nearing the end of April and I’m still (more or less) on schedule given the targets I set myself at the start of the year. In fact, I finished Day 11 before the deadline and so I took a little time to revisit Day 5 Part 2, and a few other bits of refactoring. Day 11 This was a pretty easy puzzle, and one that took the classic AoC form of “Part 1: do this for n; Part 2: OK now do it for a bigger n”. The obvious solution for Part 1 takes way way way too long to run for Part 2. Essentially each step involves doing something to each element of a list. That something returns 0, 1 or 2 new items for the next iteration. So the size of the list can double each iteration if you put back in 2 elements each time. Doing this for 25 iterations is kind of manageable, you get a list of up 33 million-ish items for each starting item. (It’s actually less because you don’t always put 2 elements in the next list, but as a worst case estimate, this is ok). Part 2 is to do the same thing for 75 iterations which puts you up in the sextillions of items. The trick for Part 2 was to realise that order doesn’t matter, and all we ultimately care about is the final total number of items. So if there are duplicate numbers in your list, you can just do the calculation once and keep track of the number of duplicates. That means, instead of keeping track of a big list of items, you keep track of a smaller list of (item, repeats) pairs. My implementation meant re-sorting and re-grouping the list every iteration, but I’m sure there’s an even more efficient way of doing it. Read more

April 3, 2025

Advent of Slowed Days 8, 9 and 10

More advent of coding! These last three days have been interesting, and the main reason it’s taken so long to solve them is finding time to do them. Day 8 Another day, another input that is interpreted as a map. I once again used the coords module I wrote for an earlier day. The story is that there are some antennas and you need to find spots where the antennas resonate with each other. What that amounts to is using a bit of vector arithmetic on the coordinates of the antennas. Read more

March 10, 2025

Advent of Slowed Days 5, 6 and 7

I am, once again, very behind schedule with my Advent of Slowed adventure. This is due to a combination of being busy at work, getting sick, my kids getting sick, and Day 5, Part 2 being annoying (I think one of my commit messages was literally “Part 2 can go to hell”). We are now somewhat back on track and I hope to catch up in the next week or two. Read more

© Seamus Bradley 2021–6

Powered by Hugo & Kiss.