C
C#16mo 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
Theos16mo 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
hiyosilver16mo ago
What happens if the input is higher or wider than twice the max size?
Omnissiah
Omnissiah16mo ago
and what's your difficulty in doing this
hiyosilver
hiyosilver16mo ago
Also, that 😄
Theos
Theos16mo 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
hiyosilver16mo ago
That doesn't really answer either question. What do you have so far and what are you struggling with?
Accord
Accord16mo 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.
Want results from more Discord servers?
Add your server