C
C#2y ago
Theos

❔ Split 2D array into 4 chunks.

Hey, I want to split a 2D array Cell[,] into 4 chunks of given max size, how can i do this?
7 Replies
Theos
TheosOP2y ago
in this example the max width & height = 5 returned chunk should also be a 2d array Cell[,]
class Cell
{
public int x, y;

public Cell(int _x, int _y)
{
x = _x;
y = _y;
}
}
class Cell
{
public int x, y;

public Cell(int _x, int _y)
{
x = _x;
y = _y;
}
}
hiyosilver
hiyosilver2y ago
What happens if the input is higher or wider than twice the max size?
FestivalDelGelato
and what's your difficulty in doing this
hiyosilver
hiyosilver2y ago
Also, that 😄
Theos
TheosOP2y ago
lets say that we have a grid 11x11. We start from the center. We want to get chunks of max size 50x50. It will simply return chunks 6x6. we just go for the maximum size possible
hiyosilver
hiyosilver2y ago
That doesn't really answer either question. What do you have so far and what are you struggling with?
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?