I checked it with check50 and its throwing error :
check50 2015.fall.pset3.fifteen fifteen.c
:) fifteen.c exists
:) fifteen.c compiles
:( init initializes 3x3 board correctly
\ expected file to be of length 18, not 0
:( init initializes 4x4 board correctly
\ expected file to be of length 38, not 0
:| 3x3 board, move blank up twice
\ can't check until a frown turns upside down
:| 3x3 board, move blank left twice
\ can't check until a frown turns upside down
I dont know why its saying log file length is 0. What can be the silly thing which I am missing. sandbox link : https://sandbox.cs50.net/checks/82d830e0be8845d58b477a73219ba555 .
I executed below 3x3.txt file of winning move but goes in infinite loop.
./fifteen 3 < ~cs50/pset3/3x3.txt
My init() code: ` void init(void) { bx=d-1; by=d-1;
//Assumption:No two tile should have same number on it.
for(int row=0; row < d; row++){
for(int col=0; col < d; col++){
if(row == d-1 && col == d-1){
board[row][col]=0;
}
else{
// printf("board[%d][%d]=",row,col);
board[row][col] = GetInt();
}
}
}
}`