If I run my program, it seems te run just fine. But when I run check50 I get this response :( init initializes 3x3 board correctly \ expected file to be of length 18, not 19 :( init initializes 4x4 board correctly \ expected file to be of length 38, not 39
What am I doing wrong, and how can I fix it?
void init(void)
{
int tileNumber = d*d-1; // Set as highest number on the board
for (int i = 0; i < d ; i++) // Set row
{
for (int j = 0; j < d; j++) // Set collum
{
board [i][j] = tileNumber;
tileNumber--;
}
}
// Set blank space to 99
board [d-1][d-1] = 99;
//If odd number of tiles, swap the tiles containing 1 and 2
if ((d == 4) || (d == 6) || (d ==8))
{
board [d-1][d-2] = 2;
board [d-1][d-3] = 1;
}
blankI = d-1;
blankJ = d-1;
}