I am absolutely stumped on what I am doing wrong here. Essentially I have a function that takes a two dimensional array of chars and tries to determine if there are five "x" chars in a row. Here is the function:

Code:

int wincheck1 ( char b[][COLS] )
{
int i, j, WIN;
for( i=0; i < ROWS; i++ ){
if(WIN == 1)
break;
else{
for ( j=1; j < (COLS-4); j++ ){
if( b[i][j] != b[i][j+1] != b[i][j+2] != b[i][j+3] != b[i][j+4] != 'x' ){
WIN=0;
}
else{
WIN=1;
break;
}
}
}
}
return WIN;
}

It appears that this code always returns 0 even when I set up the array with 5 or more x chars in a row. I have done all kinds of tinkering with this code, but it always returns zero or goes into an infinite loop, never doing what I would like. Please help.

EDIT: ignore the fact that rows start at zero and columns start at 1. That's just the way that I set up the array.

EDIT: I originally tried to put a return statement after WIN=1 in place of using break statements, but that was giving me the same headaches.