-
@constructor Chess: Setup aboardwithPiecesrepresenting an initial chessboard.-
@method getPlayer()-
@return String either "white" or "black" representing current player
-
-
@method move(piece, destination): Movepiecetodestinationand...?-
@param Piece piece to move -
@param Position destination to move piece to
-
-
@method opening(): Advance theboardto Catalan Opening, Closed Variation -
@method display()-
@return String representation of board
-
-
R,N,B,Q,K,B,N,R
P,P,P,P,P,P,P,P
, , , , , , ,
, , , , , , ,
, , , , , , ,
, , , , , , ,
p,p,p,p,p,p,p,p
r,n,b,q,k,b,n,r-
@constructor Position(x,y): Represent a position on a chessboard with coordinates- usage:
new Position(1,1) -
@property Number x coordinate -
@property Number y coordinate
- usage:
-
@constructor Piece(name, color): Represent a chesspiece on theboardwithnameandcolorand appropriate starting position- usage:
new Piece('Queen', 'black') -
@method getName()-
@return String name of Piece, e.g. 'Queen', 'Pawn'
-
-
@method getColor():-
@return String player 'black' or 'white'
-
-
@method setPosition(position): SetPiecetopositionon board-
@param Position position
-
-
@method toString()-
@return String representation of Piece - example:
"Q" === String(new Piece("Queen", "white")) - example:
"r" === String(new Piece("Rook", "black"))
-
- usage: