New variant idea
[xogo.git] / variants / Alapo / class.js
index 3707ac8..9fcfc98 100644 (file)
@@ -30,8 +30,13 @@ export default class AlapoRules extends ChessRules {
   }
 
   genRandInitBaseFen() {
-    const s =
-      FenUtil.setupPieces(['r', 'b', 'q', 'q', 'b', 'r'], {diffCol: ['b']});
+    const s = FenUtil.setupPieces(
+      ['r', 'b', 'q', 'q', 'b', 'r'],
+      {
+        randomness: this.options["randomness"],
+        diffCol: ['b']
+      }
+    );
     const piece2pawn = {
       r: 't',
       q: 's',
@@ -103,7 +108,7 @@ export default class AlapoRules extends ChessRules {
     // Try both colors (to detect potential suicides)
     let won = {};
     for (let c of ['w', 'b']) {
-      const oppCol = C.GetOppCol(c);
+      const oppCol = C.GetOppTurn(c);
       const goal = (c == 'w' ? 0 : 5);
       won[c] = this.board[goal].some((b,j) => {
         return (