return true;
}
+ static ParseFen(fen)
+ {
+ const fenParts = fen.split(" ");
+ return Object.assign(
+ ChessRules.ParseFen(fen),
+ {
+ reserve: fenParts[4],
+ promoted: fenParts[5],
+ }
+ );
+ }
+
static GenRandInitFen()
{
- const fen = ChessRules.GenRandInitFen();
- return fen.replace(" w 1111", " w 1111 0000000000 -");
+ return ChessRules.GenRandInitFen() + " 0000000000 -";
}
getFen()
}
if (res.length > 0)
res = res.slice(0,-1); //remove last comma
+ else
+ res = "-";
return res;
}
}
};
this.promoted = doubleArray(V.size.x, V.size.y, false);
- for (let square of fenParsd.promoted.split(","))
+ if (fenParsed.promoted != "-")
{
- const [x,y] = V.SquareToCoords(square);
- promoted[x][y] = true;
+ for (let square of fenParsed.promoted.split(","))
+ {
+ const [x,y] = V.SquareToCoords(square);
+ promoted[x][y] = true;
+ }
}
}
return "@" + V.CoordsToSquare(move.end);
}
}
+
+const VariantRules = CrazyhouseRules;