2025 Day 4: Printing Department

This problem about :roll_of_paper: moved so quickly that I had no need to :plunger: any of my code down the :toilet: . This seems more like a Day 1 problem than a Day 4, which leaves me queasy about Days 5-12.

I had a small issue with arrays. Somehow after index 100 the value of an uninitialized array is not valid and I got random “data“ errors. after writing `others => False` everything worked as it should. But finding the error took rather long :confused:

1 Like

That’s why I use SPARK!

Well, no, that’s not the reason. I use it because I wanted to learn it a bit, but SPARK does help preventing problems with uninitialized values.

For problem 4b, I used a standard (recursive) flooding algorithm, which in principle is faster than iterating until there are no more changes.

1 Like