#๐ can someone explain to me what this is asking pls
48 messages ยท Page 1 of 1 (latest)
@quasi lynx
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
What about it are you unsure of?
I don't get the whole question, so basically it's a grid with different cells, and it's asking to calculate the neighbours living in one cell?
but if that's the case, why in the testing part, it gives us a full grid instead of just one cell
each cell can be on or off
what does it mean to be on/off tho
given a cell, how many of its neighbours are on
if the value is 0, it is off. If the value is 1, it is on
basically, how many cell neighbours are 1s
since this is a grid, we're just scanning all the positions around the current position. We need to make sure the position we're looking at actually is on the grid
if 0, 0 is the top left corner, then our neighbour -1, 0 would not be valid
wait so if that cell is on, then we're just adding the value of the cell to the living amount right
but then in that case, x and y will the the whole grid right, not just the cell
yes, we could just sum the neighbours to get the number of neighbours that are on
your function has 3 parameters. The grid, and two coordinates
x is the grid, i and j are your coordinates
it's super confusing that they decided to use these parameter names though
oooh ok I think I get it?
they give an example for checking the top left neighbour. You just need to complete the logic for the other 7 neighbours
they show you the logic for each neighbour
ahhh ok
let's say that my current position is 3, 3
2, 2 would be the top left
2, 3 would be top mid
2, 4 would be top right
etc
oooh so basically
the number of neighbours living in one cell
is based on the neighbours living in the 8 cells around it?
each cell only holds 1 value (on or off)
and every cell has 8 neighbours
(unless a boundary)
oh so they're asking us to check the sum of the neighbours of one cell
yes, which is "how many neighbours are on of any given cell"
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.