// Potential promotions:
const finalPieces = piece == V.PAWN && x + step[0] == lastRank
? [V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN]
- : [V.PAWN];
+ : [piece];
for (let p of finalPieces) {
moves.push(
this.getBasicMove([x,y], [x+step[0],y+step[1]], {
return false;
}
+ static get VALUES() {
+ return {
+ p: 1,
+ r: 5,
+ n: 7, //the knight is valuable
+ b: 3,
+ q: 9,
+ k: 1000
+ };
+ }
+
+ static get SEARCH_DEPTH() {
+ return 2;
+ }
+
getNotation(move) {
if (move.appear.length == 2 && move.appear[0].p == V.KING)
// Castle