Pawn
Pawn The pawn objects.
Contents
Syntax
varargout = Pawn(method, varargin)
Description
This m-function contains the variables and methods for all knights.
Inputs:
- method ... What the pawn 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 pawn on field c4 [5,3]. Pawn('init',[5 3],1,'Bc4')
Move the pawn from c4 [5,3] to c5 [3 3]. Pawn('move',[5 3],[3 3])
Determine the pawns best move from c4 Pawn('best_move',[5 3])
See also
Chess, legal_move, show, remove_figure, Value_of_Figure
Signature