My plan was simple. first check if the zero is in the right place. Then see if the element is correct using a formula and adding a counter so i only do it until i reach the field where the zero should be. Somehow when i run the test that should win the game.. it asks me for more input, so i think Liam not successfully returning true for some reason :(
bool won(void)
{
int counter=0;
if (board[d-1][d-1]!=0)
{
return false;
}
for(int i=0;i<d;i++)
{
for (int j=0;j<d;j++)
{
if (counter<d*d)
{
if (board[i][j]!=1+j+d*j)
{
return false;
}
else
{
counter++;
}
}
}
}
return true;
}