Can someone please tell me is this code for the won function works ? And if not , why?
int counter=0;
for(int line=1; line<=d;line++)
{
for(int column=1;column<=d;column++)
{
if(board[line][column]!=(line-1)*d+column)
{
counter ++;
}
}
}
if(counter==(d-1) && board[d][d]==0)
return true;
else
return false;
}
Thank you a lot