if (position.length == 0) return false;
const rows = position.split("/");
if (rows.length != V.size.x) return false;
- let kings = { "w": 0, "b": 0 };
+ let kings = { 'K': 0, 'k': 0 };
for (let row of rows) {
let sumElts = 0;
for (let i = 0; i < row.length; i++) {
return squares;
}
- static GenRandInitFen(randomness) {
- if (randomness == 0)
+ static GenRandInitFen(options) {
+ if (options.randomness == 0)
return "rnqkkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNQKKBNR w 0 adehadeh -";
const replaceBishop = (fen, first, ch1, ch2) => {
};
const fen =
- CoregalRules.GenRandInitFen(randomness)
+ CoregalRules.GenRandInitFen(options)
.replace("q", "k").replace("Q", "K");
// Now replace a bishop by the queen,
// so that bishops are of different colors: