# 2023 Day 8: Haunted Wasteland

**URL:** <https://forum.ada-lang.io/t/2023-day-8-haunted-wasteland/578>\
**Category:** Advent of Code\
**Tags:** spoilers\
**Created:** [December 8, 2023, 12:05pm UTC](https://forum.ada-lang.io/t/2023-day-8-haunted-wasteland/578 "2023-12-08T12:05:34Z")\
**Posts on this page:** 4\
**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 8, 2023, 12:05pm UTC](https://forum.ada-lang.io/t/2023-day-8-haunted-wasteland/578/1 "2023-12-08T12:05:34Z")

</div>

Relatively straightforward. I suspected, correctly, that Part 2 would require the least common multiple of the individual ghosts’ times to reach a terminus. Unfortunately, I incremented my step counter at the wrong time, so that I didn’t see the regular cycle lengths of their paths.

---

<div class="post-metadata">

**Author:** ![JC001](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@JC001](https://forum.ada-lang.io/u/JC001)\
**Post date:** [December 9, 2023, 1:35pm UTC](https://forum.ada-lang.io/t/2023-day-8-haunted-wasteland/578/2 "2023-12-09T13:35:53Z")

</div>

I spent a long time trying to figure out my logic error that created an infinite loop. Finally, on my fifth rereading of the requirements, I realized I was supposed to start from AAA, not from the node on the third line in the input.

---

<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 9, 2023, 10:28pm UTC](https://forum.ada-lang.io/t/2023-day-8-haunted-wasteland/578/3 "2023-12-09T22:28:54Z")

</div>

If I may ask, what was the third node in your input? and why did you think that?

---

<div class="post-metadata">

**Author:** ![JC001](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@JC001](https://forum.ada-lang.io/u/JC001)\
**Post date:** [December 10, 2023, 11:36pm UTC](https://forum.ada-lang.io/t/2023-day-8-haunted-wasteland/578/4 "2023-12-10T23:36:05Z")

</div>

Not third node; third line of the input file, which is the first line of the node map.

As to why, the examples all had AAA as the source node on the first line of the node map, and I somehow concluded that the reason that they started from AAA was because it was that first node, not because it was AAA. This idea was entrenched strongly enough that I misinterpreted the instruction to start from AAA the first few times I read it.
