compile errors fixed

for the knight, there is no listpos array, so the element listpos[i] did not exist.
condition first checks for whether listpos == 0.
the countpieces can be either 0 or 1 (0 if we are moving a knight and not checking for a path)
and allow the move to be legal
otherwise it is an illegal move.