So I finally got the code working when it looks like this:
int k, l, m = 0;
for (k = 0; k < d; k++)
{
for (l = 0; l < d; l++)
{
if (board[k][l] == m + 1 && board[d-1][d-1] == 0)
{
m++;
}
}
}
My question is that I declared m as 0 and then in the if statement added one... If I just declare int m = 1 and then just say if board[k][l] == m instead of board[k][l] == m + 1 it no longer works. I cant for the life of me figure out why. Could anyone help me understand this? thanks!