Code covered by the BSD License  

Highlights from
Chess with "Greedy Edi"

image thumbnail

Chess with "Greedy Edi"

by

 

07 Nov 2009 (Updated )

Play chess against "Greedy Edi".

is_in_check

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:

  • from ... whether a figure has moved "from" that field.
  • global history ... the game history

Outputs:

  • answer ... Boolean answer (true if the figure was moved once).

Example

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

See also

King, Chess

Signature

  • Copyright 2006 W.Garn

Contact us