This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I used an iterative macro to add segments to the chain and evaluate whether the current path obeyed the small-cave-once criteria and/or was finished on the current iteration. I made a slight adjustment to the filter logic for the second challenge.
This is a challenge which highlights how it is tricky being able to debug iterative macros, as the example inputs don't end up duplicating small caves on the first iteration so needed a bit of blind building of the conditional part of the macro. In addition I found that I needed to cap the number of iterations at 3 more than part 1 solve to get the answer as I had some logic which was causing it to cycle back and forth (i.e. iteration - 1 would filter out repeating caves, but then it would keep adding on the pairing and it would need removing again), so I didn't have a suitable exit condition.
Macro for part 1
Macro for part 2 Slight modification to deal with the allowing a visiting one small cave once.
Chris Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
Recipe: - Set up a list of unique caves; and unique paths - Starting with the start node repeat the following: - Join to all the possible nodes based on the paths available - Remove any that go through start or end-nodes more than once - remove any that go through small caves more than once - add back anything where you only double-visit a specific small cave once