I am using the cs50 2015 code template and my code gives the correct output on my system but gives a check50 error
:) fifteen.c exists
:) fifteen.c compiles
:( 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
and so on
Here is my code
int val = d*d - 1;
for (int i = 0; i < DIM_MAX; i++)
for(int j = 0; j < DIM_MAX; j++)
board[i][j] = 0;
for (int i = 0; i < d; i ++ )
{
for(int j = 0; j < d; j ++)
{
board[i][j] = val --;
}
}
/** If dim board = even swap positions of 1 and 2 */
if (d % 2 == 0)
{
board[d-1][d-3] = 1;
board[d-1][d-2] = 2;
}
board[d-1][d-1] = -1;
Please Help!!