r/adventofcode • • Dec 17 '20

Help - SOLVED! [2020 Day 17 (Part 1)] Sample input wrong?

Before any cycles:

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


After 1 cycle:

z=-1
#..
..#
.#.

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

z=1
#..
..#
.#.

Why isn't generation 1 cycle already a 5x5x3 system? Why is in z=-1 the top left active? It only has 1 active neighbour (top row middle in z=0)? I don't understand the sample input already how that works.

143 Upvotes

113 comments sorted by

View all comments

Show parent comment

36

u/daggerdragon Dec 17 '20

That's fine for you, but don't discourage other people who want to learn.

18

u/thennal Dec 17 '20 edited Dec 17 '20

The issue is that the example is actively harmful in learning. I had the same problem as the dude above. In this case, the example doesn't help you learn, it makes you more confused. It's fine now that it's been clarified, but this stands for the original unmodified prompt.

5

u/[deleted] Dec 17 '20 edited Dec 17 '20

[removed] — view removed comment

5

u/Aneurysm9 Dec 17 '20

They didn't say "ignore the example", they said "you shouldn't have tried to understand". There is a difference and it is significant.

6

u/[deleted] Dec 17 '20

[removed] — view removed comment

1

u/Aneurysm9 Dec 17 '20

Again, that's discouraging someone from learning something. It is possible there is something to be learned about sparse representations of gridded data from understanding how the data is presented in the example. It also makes the assumption that being fast to get the expected result is the only goal, which is not the case for everyone.

-5

u/KrzaQ2 Dec 17 '20

Is the lesson here that you shouldn't trust the provided samples?

8

u/MattieShoes Dec 17 '20

The sample is correct. I used it to debug my own implementation.

2

u/Sw429 Dec 17 '20

Exactly. When my number was different for the example, I stepped through each iteration of the example to see where I was going wrong.

1

u/KrzaQ2 Dec 17 '20 edited Dec 17 '20

So did I. And it took me coming here to see that the example was deceptive and there was no bug in my implementation.

-1

u/MattieShoes Dec 17 '20

There's an infinite 3d grid and they're showing you the relevant part of it, but because you assumed they'd show you an irrelevant part of it, it's "deceptive" rather than "a stupid assumption on your part".

1

u/KrzaQ2 Dec 18 '20

A "stupid assumption" I've been led into by the last five years of AoC challenges.

1

u/MattieShoes Dec 18 '20

sorry, musta been grouchy. "a bad assumption"