Development Log, January 2025
2025/02/19
December was a month of coding challenges, as I took on Advent of Code, and January was a slow month of vacationing in Uruguay, then reintegrating into the real world.
Advent of Code
Every year since its inception I’ve participated in Advent of Code, an annual advent calendar of coding challenges that get released throughout the month of December, with the eventual goal of completing each day and saving Christmas.
Challenges are released each night at 12AM Eastern Time, meaning that I get them at a cool 9PM Pacific. Most nights I hope on a call with some friends and we chat about past challenges and when we’ll encounter certain theories or formulas that have been the hardest challenges in past years.
This year, I ended up with a total of 40/50 stars (challenges solved) at the end of December.
Of all the challenges this year, I think the one I had the most fun with was Day 14, simulating the movement of robots, and finding when they arrange themselves in a Christmas tree shape. You can find my code here which was to basically just continue the simulation and search for a bunch of robots lining up in a row. How I actually solved it realtime though was printing every state of the simulation to my terminal and just using Cmd+F to search for an unlikely number of robots in a single row – I think it was ~10 or so, and it took me straight to the state that output the tree! I ended up 324th overall that day, one of my best performances this year.
Hot Chocolate Fest
Every January in Vancouver Hot Chocolate Fest begins. Their website is always a little difficult to navigate, and it’s never easy to find nearby participating cafés with good flavours. So this year I gave myself a fun little challenge – 3 days to build a better app than they had. Here’s the final result.
First, scraping the data. The website is annoying to navigate and, so too, was the data source. I ended up scraping 2 pages – the first for the vendor names and details of the hot chocolates they were selling, and the second for the vendor locations from a custom Google Map.
With the data scraped and cleaned up into convenient JSONs for me to read, I began building an interface. I chose SwiftUI simply because I have familiarity with it, it’s quick for bootstrapping, and I wanted this done fast. I also chose SwiftData for the little data I wanted to store alongside the scraped data. This ended up being a mistake – I’ve never used SwiftData personally, and it wasn’t intuitive to map the data I had to the storage format I wanted/SwiftData expected. In the end, I switched over to Pointfree’s Sharing library, which simplified things a lot.
The end result was a simple little app that listed all the vendors and flavours, with a search by name, or a filter by allergens, as well as a map with details of the vendors and offerings. Unfortunately, Hot Chocolate Fest only lasts 1 month and I started this project halfway into the event. Hopefully I can dust it off next January and use it then!