该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
return true;
}
x++;
}
return false;
}
bool isLeftInclinedWin(bool isBlack,int x,int y)
{
char c = isBlack ? '@':'O';
int count;
while(x>0 && y>0 && state[x][y] == c)
{
y--;
x--;
}
count =0;
if(state[x][y] == c) count = 1;
x++;
y++;
while(x < N && y < N && state[x][y] == c)
{
count++;
if(count == 5)
{
return true;
}
x++;
y++;
}
return false;
}
bool isRightObliqueWin(bool isBlack,int x,int y)
{
char c = isBlack ? '@':'O';
int count;
while(x>0 && y
{
y++;
x--;
}
count =0;
if(state[x][y] == c) count = 1;
x++;
y--;
while(x < N && y >= 0 && state[x][y] == c)
{
count++;
if(count == 5)
{
return true;
}
x++;
y--;
}
return false;
}
void init(void)
{
int i,j;
for(i=0;i
{
for(j=0;j
{
state[i][j] = '*';