How does this work...
now if any of the array returns blank it falls but I want it so if even one != blank it will return a collision.Code:for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) if(map[i][j] == blank) collision = 0;
How does this work...
now if any of the array returns blank it falls but I want it so if even one != blank it will return a collision.Code:for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) if(map[i][j] == blank) collision = 0;
I'm making assumptions here, because I can't really tell what your looking for, or how your code works... If you want 'collision' to be non-zero if one space on the 'grid' (I'm assuming) isn't 'blank':
Or is you want to know if 'at least one' was not blank only:Code:collision = 0; for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) if(map[i][j] != blank) collision++;
Hope this helpsCode:bool collision = false; for(int i = 0; i < 4 && !collision; i++) for(int j = 0; j < 4 && !collision; j++) if(map[i][j] != blank) collision = true;
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
yeah sorry about that...
I figured it out though.. I just needed to clear my variables before the loops.