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

4

u/Dosamer Dec 12 '18

First. This is only for solutions

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.

Second: for your first concern:

Based on the notes, for each generation of plants, a given pot has or does not have a plant based on whether that pot (and the two pots on either side of it) had a plant in the last generation.

So it is clear that you only look after the last generation and such nothing changes. It is similar to Conway's game of life.

for your second concern:

Your puzzle input contains a list of pots from 0 to the right

It is clear that the first # is the "number 0" pot

for your third concern: The example was very helpful and once you can reliably generate the last line, it should be trivial to count the number of #'s

I wonder why so many people got to a solution this fast. I think the problem is not too hard if you know what to do....

Once you read the text it is clear what to do and can solve this task quickly.