Code covered by the BSD License  

Highlights from
Chess with "Greedy Edi"

image thumbnail
from Chess with "Greedy Edi" by Wolfgang Garn
Play chess against "Greedy Edi".

getColor

getColor

findPos Determines the color of a certain field

Contents

Syntax

color = getColor(from)

Description

The color (black or white) of the figure from a certain field is determined.

Inputs:

  • from ... field in matrix notation, from which to obtain the color
  • board ... chess board and related information

Outputs:

  • color ... figure color of a certain chess field (0..black,1...white)

Example

Assume there is a white knight on f3 [6 6], then getColor([6 6]) returns one for the white color.

See also

Chess, stopCursor

Signature

  • Copyright 2006 W.Garn

Contact us at files@mathworks.com