Hello ARDUBOY community!
I am stuck trying to develop a new game as I can’t get two dimensional arrays working. Trying to define a two dimensional array that is 15 by 7 with a random value for each x,y coordinate.
int ter[15][7];
for (int x = 1; x < 16; x++)
{
for(int y = 1; y < 8 ; y++)
{
int r = rand() % 9 + 1;
ter[x][y] = r;
}
}
When I try to use this in and “if” statement it doesn’t seems to have any effect. Also if I try to print ter[x ][y] my ARDUBOY crashes! Can anyone give me some assistance on two dimensional arrays?
weird, apparently you can’t put an x in square brackets or it creates a checkmark