Trying to make connect4 and I want to check if a column (vertical) is full, so the easy way to do it would be in an if
with [i, 1] != O && [i, 2] != O && [i, 3] != O
et cetera, but isn't there a more efficient way to go on about this?
A board looks like:
O O O O O O O O
O O O O O O O O
O O O O O O O O
O O O O O O O O
O O O O O O O O
O O O O O O O O
The for-loop:
for (int i = row - 1; i > -1; i--)
{
if (board[i, column].ToString() == "O" && beurt % 2 == 0)
{
board[i, column] = (Veld)player1.color;
beurt += 1;
break;
}
else if(board[i, column].ToString() == "O" && beurt % 2 == 1)
{
board[i, column] = (Veld)player2.color;
beurt += 1;
break;
}
else if(???)
{
//???
}
}