Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

633000 Views

Latest files of /cody/69PercentFat/Js-Chess/pieces

Pawn.js cody/69PercentFat/Js-Chess/pieces/Pawn.js
167 Views
0 Comments
class Pawn extends Piece {
constructor(position, name) {
super(position, 'pawn', name)
}

getAllowedMoves() {
const position = this.position;
const mathSign = (this.color === 'white') ? 1: -1;
Queen.js cody/69PercentFat/Js-Chess/pieces/Queen.js
173 Views
0 Comments
class Queen extends Piece {
constructor(position, name) {
super(position, 'queen', name);
}

getAllowedMoves(){
return [
this.getMovesTop(),
Piece.js cody/69PercentFat/Js-Chess/pieces/Piece.js
168 Views
0 Comments
class Piece {
constructor(position, rank, name) {
this.position = position;
this.rank = rank;
this.name = name;
this.color = this.name.substring(0,5);
}

Rook.js cody/69PercentFat/Js-Chess/pieces/Rook.js
166 Views
0 Comments
class Rook extends Piece {
constructor(position, name) {
super(position, 'rook', name);
this.ableToCastle = true;
}

changePosition(position) {
this.position = parseInt(position);
King.js cody/69PercentFat/Js-Chess/pieces/King.js
168 Views
0 Comments
class King extends Piece {
constructor(position, name) {
super(position, 'king', name);
this.ableToCastle = true;
}


getAllowedMoves() {
Bishop.js cody/69PercentFat/Js-Chess/pieces/Bishop.js
174 Views
0 Comments
class Bishop extends Piece {
constructor(position, name) {
super(position, 'bishop', name);
}

getAllowedMoves() {
return [ this.getMovesTopRight(), this.getMovesTopLeft(), this.getMovesBottomRight(), this.getMovesBottomLeft() ];
}
Knight.js cody/69PercentFat/Js-Chess/pieces/Knight.js
167 Views
0 Comments
class Knight extends Piece {
constructor(position, name) {
super(position, 'knight', name);
}

getAllowedMoves() {
const position = this.position;
return [