Change castle flags. Eightpieces still not OK, but almost
[vchess.git] / client / src / variants / Shatranj.js
index bb00101..c364b81 100644 (file)
@@ -1,6 +1,3 @@
-// TODO: bishop OK, but queen should move vertical/horizontal and capture diagonally.
-// ==> then the pawn promotion is a real promotion (enhancement).
-
 import { ChessRules } from "@/base_rules";
 
 export const VariantRules = class ShatranjRules extends ChessRules {
@@ -21,8 +18,9 @@ export const VariantRules = class ShatranjRules extends ChessRules {
     ];
   }
 
-  static GenRandInitFen() {
-    return ChessRules.GenRandInitFen().replace("w 1111 -", "w");
+  static GenRandInitFen(randomness) {
+    // Remove castle flags and en-passant indication
+    return ChessRules.GenRandInitFen(randomness).slice(0, -7);
   }
 
   getPotentialPawnMoves([x, y]) {