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;

Printable View

- 05-30-2003Disturbed1Help!
How does this work...

Code:`for(int i = 0; i < 4; i++)`

for(int j = 0; j < 4; j++)

if(map[i][j] == blank) collision = 0;

- 05-30-2003Zach L.
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':

Code:`collision = 0;`

for(int i = 0; i < 4; i++)

for(int j = 0; j < 4; j++)

if(map[i][j] != blank)

collision++;

Code:`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;

- 05-30-2003Disturbed1
yeah sorry about that...

I figured it out though.. I just needed to clear my variables before the loops.