ASSIGNMENTS/AI-ASSIGNMENT 1/AI ASSIGNMENT-1-1ST HEURISTIC.c
//TO CHECK WHETHER SOLUTION EXISTS OR NOT

TO CHECK WHETHER SOLUTION EXISTS OR NOT
TO CHECK WHETHER SOLUTION EXISTS OR NOT
bool issolvable(int board[4][4]){
int invcount=getinversionspairs((int *) board);
int position=findxpositiofrombottom(board);
if(position & 1)
    return !(invcount & 1);
else
    return invcount & 1;
}
bool issolvable ( int board [ 4 ] [ 4 ] ) { int invcount = getinversionspairs ( ( int * ) board ) ; int position = findxpositiofrombottom ( board ) ; if ( position & 1 ) return ! ( invcount & 1 ) ; else return invcount & 1 ; }
TO CHECK WHETHER SOLUTION EXISTS OR NOT
TO CHECK WHETHER SOLUTION EXISTS OR NOT