Update chess.c

Add function prototypes, add more logic to legal move function