r/adventofcode • • Dec 16 '17

SOLUTION MEGATHREAD -๐ŸŽ„- 2017 Day 16 Solutions -๐ŸŽ„-

--- Day 16: Permutation Promenade ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Need a hint from the Hugely* Handyโ€  Haversackโ€ก of Helpfulยง Hints^ยค?

Spoiler


[Update @ 00:08] 4 gold, silver cap.

[Update @ 00:18] 50 gold, silver cap.

[Update @ 00:26] Leaderboard cap!

  • And finally, click here for the biggest spoilers of all time!

This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked!

13 Upvotes

229 comments sorted by

View all comments

Show parent comment

1

u/Smylers Dec 16 '17

It looks like that relies on the cycle returning you to the starting position abc...p. What if the cycle is like on dayย 6, where there are some initial states (never repeated) and then the cycle takes you back to the state just after those?

Or is it impossible to construct an input for which that would happen?

2

u/[deleted] Dec 16 '17

My gut tells me that it should always cycle back to the initial state but I don't have a proper answer for you (so my gut may be wrong).

2

u/mschaap Dec 16 '17

I think you're probably right, too. I wasn't sure enough to assume that, so my version does handle a loop that starts later, if that would happen.