Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Cylinder.js
index 2324bdc..bcb5393 100644 (file)
@@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array";
 import { randInt, shuffle } from "@/utils/alea";
 
 export class CylinderRules extends ChessRules {
+
   // Output basically x % 8 (circular board)
   static ComputeY(y) {
     let res = y % V.size.y;
@@ -21,7 +22,7 @@ export class CylinderRules extends ChessRules {
       let j = V.ComputeY(y + step[1]);
       while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) {
         moves.push(this.getBasicMove([x, y], [i, j]));
-        if (oneStep !== undefined) continue outerLoop;
+        if (oneStep) continue outerLoop;
         i += step[0];
         j = V.ComputeY(j + step[1]);
       }
@@ -154,4 +155,5 @@ export class CylinderRules extends ChessRules {
       k: 1000
     };
   }
+
 };