is_in_check

is_in_check Whether a figure will be in check.

Contents

Syntax

[answer, color] = is_in_check(from, to)

Description

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.

Inputs:

Outputs:

Example

Assume you like to do the castling. The the kings method 'possible' will call has_moved([8 8]).

See also

King, Chess

Signature