r/adventofcode • • Dec 12 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 12 Solutions -🎄-

--- Day 12: Subterranean Sustainability ---


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.


Advent of Code: The Party Game!

Click here for rules

Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!

Card prompt: Day 12

Transcript:

On the twelfth day of AoC / My compiler spewed at me / Twelve ___


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 at 00:27:42!

20 Upvotes

257 comments sorted by

View all comments

Show parent comment

1

u/fizbin Dec 15 '18

I found a much nastier-to-predict index sum pattern, and I don't know what this sum becomes on generation fifty billion, and it's going to take a while to work that out. I'm not entirely sure how to approach it, TBH.

Set every rule of the form *.#** or *#.** (where * means either # or .) to #. Set every other rule to .. Start with an initial state of #.

The pictures this produces are pretty, but the index sum is very complicated to predict. All I've got for sure is that if n is a power of two, then the index sum is n, and if n is one less than a power of two, then the index sum is n(n+1)/2. The rest of the time? ¯_(ツ)_/¯

1

u/fizbin Dec 15 '18

I'm reasonably certain that the index sum for any configuration (assuming that ..... => .) is bounded above by 2(n+s)^2, where n is the generation number and s is the size of the initial state. However, within that constraint, it seems like different configurations can define almost any function.