# 2025 Day 4: Printing Department

**URL:** <https://forum.ada-lang.io/t/2025-day-4-printing-department/4011>\
**Category:** Advent of Code\
**Tags:** ada, spoilers\
**Created:** [December 4, 2025, 6:31pm UTC](https://forum.ada-lang.io/t/2025-day-4-printing-department/4011 "2025-12-04T18:31:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cantanima](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/cantanima/32/121_2.png) [@cantanima](https://forum.ada-lang.io/u/cantanima)\
**Post date:** [December 4, 2025, 6:31pm UTC](https://forum.ada-lang.io/t/2025-day-4-printing-department/4011/1 "2025-12-04T18:31:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AdaOrbit](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/adaorbit/32/879_2.png) [@AdaOrbit](https://forum.ada-lang.io/u/AdaOrbit)\
**Post date:** [December 5, 2025, 1:56am UTC](https://forum.ada-lang.io/t/2025-day-4-printing-department/4011/2 "2025-12-05T01:56:14Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![tgv](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/tgv/32/548_2.png) [@tgv](https://forum.ada-lang.io/u/tgv)\
**Post date:** [December 5, 2025, 7:30pm UTC](https://forum.ada-lang.io/t/2025-day-4-printing-department/4011/3 "2025-12-05T19:30:06Z")

</div>

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.
