(There's not an actual function where I need this, but I was just wondering.)
Imagine this function where I pass a bool[,]
. This bool[,]
is named grid1
or grid2
, depending on the situation.
I was wondering if I can do anything like the following:
void CheckGrid(bool[,] grid, int number)
{
for (int x = 0; x <= gridXmax - 1; x++)
{
for (int y = 0; y <= gridYmax - 1; y++)
{
if(grid + number[x,y]) //this will check against grid1 or grid2, depending on int number
//logic depends on whether it's grid1 or grid2
}
}
}
Guessing by the questions for other languages, it probably isn't possible. But you never know :)
It is well possible I'm missing something obvious here - I'm not really experienced.