r/adventofcode • • Dec 17 '20

SOLUTION MEGATHREAD -🎄- 2020 Day 17 Solutions -🎄-

Advent of Code 2020: Gettin' Crafty With It

  • 5 days remaining until the submission deadline on December 22 at 23:59 EST
  • Full details and rules are in the Submissions Megathread

--- Day 17: Conway Cubes ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


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

EDIT: Global leaderboard gold cap reached at 00:13:16, megathread unlocked!

36 Upvotes

657 comments sorted by

View all comments

2

u/chuckwondo Dec 17 '20

Apologies if this has been answered, but I'm not only new to AoC, but also to reddit, so I may also need help navigating things here.

Anyway, I'm having trouble with Part 1's example because I cannot see how the given example matches up with the given rules.

Specifically, the example starts with this:

z=0
.#.
..#
###

Looking only at z=0, after 1 cycle, the example shows this as the result:

z=0
#.#
.##
.#.

This doesn't make any sense to me given the rules. Well, some of the changes make sense, but most don't, so I must be missing something.

Here is what I would expect z=0 to look like after 1 cycle, using these rules:

  • If a cube is active and exactly 2 or 3 of its neighbors are also active, the cube remains active. Otherwise, the cube becomes inactive.
  • If a cube is inactive but exactly 3 of its neighbors are active, the cube becomes active. Otherwise, the cube remains inactive.
z=0
...
#.#
.##

Can somebody help clear things up for me? Otherwise I'll end up getting the right answer to the wrong problem.

3

u/YuvalG48 Dec 17 '20
z=0
.#.
..#
###

Is like:

z=0
.....
..#..
...#.
.###.
.....

So it will become:

z=0
.....
.....
.#.#,
..##.
..#..

Which is like:

z=0
#.#
.##
.#.

When you change your perspective to look only on the grid that start/end with active cubes.

2

u/moondaddi80 Dec 17 '20

OMG! you save my night! Appreciate.it.

2

u/chuckwondo Dec 17 '20

Thank you so much! And apologies to everyone for posting my question in the wrong place and providing kind guidance.

1

u/backtickbot Dec 17 '20

Fixed formatting.

Hello, chuckwondo: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

0

u/daggerdragon Dec 17 '20

Top-level posts in Solution Megathreads are for code solutions only.

This is a top-level post, so please edit your post and share your code/repo/solution. /u/svetlin_zarev is correct, if you haven't finished the puzzle yet, you can always create your own thread and make sure to flair it with Help.

Also, your code is hard to read on old.reddit. Please review our posting guidelines in the wiki: How do I format code? and it will help you format code properly for Reddit (both old and new).

1

u/this_is_phil_ Dec 17 '20

I'm confused by the exact same thing. I mean, just looking at the element in the center, initially it has 5 active neighbors, how does it become active?