for the final part of fifteen, my game wins automatically upon start up and I'm not sure why, please help, thanks.
my code is as follows:
bool won(void)
{
//for each row
for (int i = 0; i < d; i++)
{
//for each column
for (int j = 0; j < d; j++)
{
if (board[i][j] != (((d*i) + j) + 1) && board[d-1][d-1] != 0)
{
return false;
}
}
}
return true;
}