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".

King

King

King The King objects.

Contents

Syntax

varargout = King(method, varargin)

Description

This m-function contains the variables and methods for all kings.

Inputs:

  • method ... What the king instance wants (i.e move, best_move,init,...).
  • varargin ... parameters required for the method(i.e from, to, ...)
  • global board ... chess board and related information

Outputs:

  • varargout ... outputs generated by the method (i.e. best move, legal move,...)
  • global board ... updated chess board and related information

Example

Add a white king on field c4 [5,3]. King('init',[5 3],1,'Bc4')

Move the king from c4 [5,3] to d5 [4 4]. King('move',[5 3],[4 4])

Determine the kings best move from c4 King('best_move',[5 3])

See also

Chess, legal_move, show, remove_figure, Value_of_Figure

Signature

  • Copyright 2006 W.Garn

Contact us