// 计数器清零
count = 0;
// 验证水平方向,向左验证
for (int i = currentCol; i >= 0; i--)
{
if (isSameChess(currentRow, i))
{
count++;
if (count == 5)
return true;
}
else
break;
}
// 验证水平方向,向右验证
for (int i = currentCol + 1; i < Chessboard.GetLength(0); i++)
{
if (isSameChess(currentRow, i))
{
count++;
if (count == 5)
return true;
}
else
break;
}
// 计数器清零
count = 0;
// 验证西北至东南方向,向西北验证
for (int i = currentRow, j = currentCol; i >= 0 && j >= 0; i--, j--)
{
if (isSameChess(i, j))
{
count++;
|