chess
Version:
An algebraic notation driven chess engine that can validate board position and produce a list of viable moves (notated).
21 lines (16 loc) • 381 B
JavaScript
/**
The simple definition of a rank & file within a board.
Additionally, if a Piece occupies a square on a board, the
square contains the reference to the piece.
*/
export class Square {
constructor (file, rank) {
this.file = file;
this.piece = null;
this.rank = rank;
}
static create (file, rank) {
return new Square(file, rank);
}
}
export default { Square };