Board
The board game.
The board contains a 8x8 matrix with every square containing a piece, either black, white or neutral.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
The board matrix.
The board matrix.
Attributes
- Returns
-
The board matrix.
Initialize the chess board.
Initialize the chess board.
Put all the pieces on their starting square. White pieces on the 1st row, white pawns on the 2nd row, black pieces on the 8th row and black pawns on the 7th row.
Attributes
Move the piece on the board.
Move the piece on the board.
It first replaces its starting square with a neutral piece. It then replaces the target position with the piece.
Value parameters
- newPos
-
The position the piece moves.
- piece
-
The piece to move.
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
Visualize the board.
Visualize the board.
Shows the chess board from either white or black perspective. Columns names are indicates at the bottom, and row numbers are on the left side of each row.
Every piece is represented as their toString() method.
Value parameters
- side
-
The perspective of the board, either black or white.
Attributes
- Returns
-
The chess board with all the pieces.