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

-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"