- pieces[c][rook1Pos] = 'r';
- pieces[c][knight1Pos] = 'n';
- pieces[c][bishop1Pos] = 'b';
- pieces[c][queenPos] = 'q';
- pieces[c][camel1Pos] = 'c';
- pieces[c][camel2Pos] = 'c';
- pieces[c][wildebeestPos] = 'w';
- pieces[c][kingPos] = 'k';
- pieces[c][bishop2Pos] = 'b';
- pieces[c][knight2Pos] = 'n';
- pieces[c][rook2Pos] = 'r';
- }
- return pieces["b"].join("") +
- "/ppppppppppp/11/11/11/11/11/11/PPPPPPPPPPP/" +
- pieces["w"].join("").toUpperCase() +
- " w 1111 -";
- }
-}
+ randIndex = randInt(5);
+ let queenPos = positions[randIndex];
+ positions.splice(randIndex, 1);
+
+ // Random square for wildebeest
+ randIndex = randInt(4);
+ let wildebeestPos = positions[randIndex];
+ positions.splice(randIndex, 1);
+
+ let rook1Pos = positions[0];
+ let kingPos = positions[1];
+ let rook2Pos = positions[2];
+
+ pieces[c][rook1Pos] = "r";
+ pieces[c][knight1Pos] = "n";
+ pieces[c][bishop1Pos] = "b";
+ pieces[c][queenPos] = "q";
+ pieces[c][camel1Pos] = "c";
+ pieces[c][camel2Pos] = "c";
+ pieces[c][wildebeestPos] = "w";
+ pieces[c][kingPos] = "k";
+ pieces[c][bishop2Pos] = "b";
+ pieces[c][knight2Pos] = "n";
+ pieces[c][rook2Pos] = "r";
+ flags += V.CoordToColumn(rook1Pos) + V.CoordToColumn(rook2Pos);
+ }
+ return (
+ pieces["b"].join("") +
+ "/ppppppppppp/92/92/92/92/92/92/PPPPPPPPPPP/" +
+ pieces["w"].join("").toUpperCase() +
+ " w 0 " + flags + " -"
+ );
+ }
+};