This is my init function, please check and suggest:
void init(void)
{
int size= d*d;
for (int i=0;i<d;i++)
{
for (int j=0;j<d;j++)
{
board[i][j]=size-1;
size -= 1;
}
}
//if even
if (size%2==0)
{
board [d-1][d-2]=2;
board [d-1][d-3]=1;
}
}