Chess with "Greedy Edi"
07 Nov 2009
24 Jan 2012)
Play chess against "Greedy Edi".
is_in_check Whether a figure will be in check.
[answer, color] = is_in_check(from, to)
If a figure is moved from a to b, whether and if, which color is in check
This function is useful for the castling and to check whether a move is legal.
- from ... whether a figure has moved "from" that field.
- global history ... the game history
- answer ... Boolean answer (true if the figure was moved once).
Assume you like to do the castling. The the kings method 'possible' will call has_moved([8 8]).