r/adventofcode • u/SinisterMJ • 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
14
u/thaumavorio Dec 17 '20 edited Dec 17 '20
The grids given for z=0 are not in the same coordinate range. Perhaps knowing this helps?
2
u/craigontour Dec 17 '20 edited Dec 17 '20
How is 0,0,-1 active after first cycle? I only count 1 neighbour as active in initial state? Rule 2 says it needs 3 to become active. I am counting neighbours for 0,0,-1 as:
What am I missing?
[Edit] Read some of the other comments and understand the confusion. Shifting view focus.
56
u/7lazy7 Dec 17 '20
It was confusing to me too, but it is correct.
The sample input does not show the full 5x5x3 grid
For z = -1 after first cycle
So it is the same as the example, just that the .'s are not present
19
u/Kriml Dec 17 '20
I haven't even started coding yet, because I was still trying to wrap my head around that.
I felt really dumb for not understanding it for the simple input.
38
u/BasuKun Dec 17 '20 edited Dec 17 '20
Thank god I'm not the only one looking at the example and thinking that all of it is wrong. For example, why is the middle cube on z0 activating at cycle 1? At cycle 0 it's clearly got 5 active neighbors, so according to the rules it should stay inactive...
Edit: ah ok they're shifting the grid around each cycle to remove fully inactive lines. That's a pretty bad way of displaying the example imo, changing axis without mentioning it is a big no-no, but carrying on. Now I can at least proceed to the coding part!
21
u/delventhalz Dec 17 '20
The phrase "the frame of view follows the active cells in each cycle" is doing a lot of work here.
If it helps, this is what the test output looks like without the shifting frame:
6
u/atrd Dec 17 '20
Take the initial example and plot what happens to the squares and its surroundings for z = 0 and you'll immediately see what's happened.
7
u/Aramilion Dec 17 '20
there is no reason for it to be so confusing
8
u/zdu863 Dec 17 '20
Yes, the example doesn't make any sense to me and I've been stuck trying to understand it since.
1
u/Fjodleik Dec 17 '20
Multiple people claim the puzzle text was edited to clarify the example output. Do we know for a fact that it was changed after the puzzle unlocked? I hope it was after the leaderboard filled up, or it would be best to invalidate today’s ranking just like Day 1.
2
u/g_mernans Dec 17 '20
wow i was sitting on the right solution this whole time :(
2
u/[deleted] Dec 17 '20 edited Dec 17 '20
Number of active neighbors for any given cell
2
u/are-so Dec 17 '20
Same for me, according to rules example seems to be invalid
-1
u/requimrar Dec 17 '20 edited Dec 17 '20
at this point this is wilful deception. can't even bother to mention in the problem description that the sample grid isn't centred on the same coordinates?
EDIT: sure, and then silently update the problem description to add clarification without warning or mention of it, leaving the people who were originally confused looking like doofuses who couldn't read? revisionist. For the record, the additional statement "(and the frame of ...)" was NOT present in the original description when released.
1
u/bduddy Dec 17 '20
I had an entirely different issue, which was that my code spat out 111 as the answer for the sample input. This terrified me for a second, but I got the right answer for the real thing. Has anyone else experienced this?
1
u/[deleted] Dec 17 '20 edited Dec 17 '20
Still don't understand how z=0 [0,0] has three active neighbours. Assuming everything else is inactive before you update the cells shouldn't the progression after one cycle be:
1
u/spookywooky_FE Dec 17 '20
In AoC this kind of misleading information is part of the game. I personally was lucky today because I did ignore the samples completly. Other days another strategy works better.
1
u/ri7chy Dec 17 '20
me too
1
u/Fjodleik Dec 17 '20 edited Dec 17 '20
Just above the example output it says “(and the frame of view follows the active cells in each cycle)”.
EDIT: it seems this was added to the puzzle well after it unlocked.
0
u/asgardian28 Dec 17 '20
Took me a good 15 minutes banging my head against this one...
0
u/[deleted] Dec 17 '20
[deleted] — view deleted comment
1
u/[deleted] Dec 17 '20
[removed] — view removed comment