Chess with "Greedy Edi"
07 Nov 2009
24 Jan 2012)
Play chess against "Greedy Edi".
legal_move checks whether a move is legal.
answer = legal_move
It is checked whether a chess figures move (stored in global structure cursor) is legal or not.
Note: That this function calls the chess figure class identified by the figure which is on the "from" field. This function
is called from the stopCursor event-function.
- global cursor ... cursor information (contains the move "from" "to")
- global board ... chess board and related information
- answer ... Boolean answer (1... legal move, 0 ... not allowed)
Assume there is a global board information, describing the chess board and a global cursor structure. The cursor structure
contains the fields from and to. The function legal_move will check whether the move "cursor.from" to "cursor.to" is legal.
King, Queen, Knight, Bishop, Rook, Pawn, stopCursor