comparison day8.txt @ 19:1e16a25a9553

Strip down the text to just the puzzle, not the fluff
author IBBoard <dev@ibboard.co.uk>
date Mon, 11 Dec 2023 20:38:55 +0000
parents a7fb64b48830
children
comparison
equal deleted inserted replaced
18:ddb69833346c 19:1e16a25a9553
1 --- Day 8: Haunted Wasteland --- 1 --- Day 8: Haunted Wasteland ---
2 2
3 You're still riding a camel across Desert Island when you spot a sandstorm quickly approaching. When you turn to warn the Elf, she disappears before your eyes! To be fair, she had just finished warning you about ghosts a few minutes ago. 3 You have a map that describes a list of nodes. It seems like you're meant to use the left/right instructions to navigate the network.
4 4
5 One of the camel's pouches is labeled "maps" - sure enough, it's full of documents (your puzzle input) about how to navigate the desert. At least, you're pretty sure that's what they are; one of the documents contains a list of left/right instructions, and the rest of the documents seem to describe some kind of network of labeled nodes. 5 AAA is where you are now, and you have to follow the left/right instructions until you reach ZZZ.
6
7 It seems like you're meant to use the left/right instructions to navigate the network. Perhaps if you have the camel follow the same instructions, you can escape the haunted wasteland!
8
9 After examining the maps for a bit, two nodes stick out: AAA and ZZZ. You feel like AAA is where you are now, and you have to follow the left/right instructions until you reach ZZZ.
10 6
11 This format defines each node of the network individually. For example: 7 This format defines each node of the network individually. For example:
12 8
13 RL 9 RL
14 10
32 28
33 Starting at AAA, follow the left/right instructions. How many steps are required to reach ZZZ? 29 Starting at AAA, follow the left/right instructions. How many steps are required to reach ZZZ?
34 30
35 --- Part Two --- 31 --- Part Two ---
36 32
37 The sandstorm is upon you and you aren't any closer to escaping the wasteland. You had the camel follow the instructions, but you've barely left your starting position. It's going to take significantly more steps to escape! 33 The number of nodes with names ending in A is equal to the number ending in Z! You actually have to start at every node that ends with A and follow all of the paths at the same time until they all simultaneously end up at nodes that end with Z.
38
39 What if the map isn't for people - what if the map is for ghosts? Are ghosts even bound by the laws of spacetime? Only one way to find out.
40
41 After examining the maps a bit longer, your attention is drawn to a curious fact: the number of nodes with names ending in A is equal to the number ending in Z! If you were a ghost, you'd probably just start at every node that ends with A and follow all of the paths at the same time until they all simultaneously end up at nodes that end with Z.
42 34
43 For example: 35 For example:
44 36
45 LR 37 LR
46 38