const piece = this.getPiece(x,y);
const steps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
const kp = this.kingPos[color];
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
for (let step of steps)
{
let [i,j] = [x+step[0],y+step[1]];
getAllValidMoves(computer)
{
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
let potentialMoves = [];
for (let i=0; i<V.size.x; i++)
{
if (move.appear[0].p == V.KING && move.appear[1].p == V.ROOK)
return (move.end.y < move.start.y ? "0-0-0" : "0-0");
// Switch:
- const startSquare =
- String.fromCharCode(97 + move.start.y) + (V.size.x-move.start.x);
- const finalSquare =
- String.fromCharCode(97 + move.end.y) + (V.size.x-move.end.x);
- return "S" + startSquare + finalSquare;
+ return "S" + V.CoordsToSquare(move.start) + V.CoordsToSquare(move.end);
}
}