Almost added TitanChess + EvolutionChess
[vchess.git] / client / src / variants / Alice.js
index 82ba6b7..16ccb84 100644 (file)
@@ -5,6 +5,7 @@ import { ArrayFun } from "@/utils/array";
 // TODO? atLeastOneMove() would be more efficient if rewritten here
 // (less sideBoard computations)
 export class AliceRules extends ChessRules {
+
   static get ALICE_PIECES() {
     return {
       s: "p",
@@ -72,7 +73,7 @@ export class AliceRules extends ChessRules {
         if (['K','k','L','l'].includes(row[i])) kings[row[i]]++;
         if (V.PIECES.includes(row[i].toLowerCase())) sumElts++;
         else {
-          const num = parseInt(row[i]);
+          const num = parseInt(row[i], 10);
           if (isNaN(num)) return false;
           sumElts += num;
         }
@@ -101,7 +102,7 @@ export class AliceRules extends ChessRules {
               this.kingPos["w"] = [i, k];
               break;
             default: {
-              const num = parseInt(rows[i].charAt(j));
+              const num = parseInt(rows[i].charAt(j), 10);
               if (!isNaN(num)) k += num - 1;
             }
           }
@@ -366,4 +367,5 @@ export class AliceRules extends ChessRules {
       notation += "=" + move.appear[0].p.toUpperCase();
     return notation;
   }
+
 };