X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRococo.js;h=66d9615a33136a5fabf6b4c08b5df7bc986fbabe;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=0cfb5dc7aa7d53915a520e1918a7e5965538eedf;hpb=e90bafa8fb5fb7641728231bf2398590d96c672a;p=vchess.git diff --git a/client/src/variants/Rococo.js b/client/src/variants/Rococo.js index 0cfb5dc7..66d9615a 100644 --- a/client/src/variants/Rococo.js +++ b/client/src/variants/Rococo.js @@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array"; import { shuffle } from "@/utils/alea"; export class RococoRules extends ChessRules { + static get HasFlags() { return false; } @@ -15,6 +16,15 @@ export class RococoRules extends ChessRules { return ChessRules.PIECES.concat([V.IMMOBILIZER]); } + static get Lines() { + return [ + [[1, 1], [1, 9]], + [[1, 9], [9, 9]], + [[9, 9], [9, 1]], + [[9, 1], [1, 1]] + ]; + } + getPpath(b) { if (b[1] == "m") //'m' for Immobilizer (I is too similar to 1) @@ -45,7 +55,7 @@ export class RococoRules extends ChessRules { this.kingPos["w"] = [i, k]; break; default: { - const num = parseInt(position[i].charAt(j)); + const num = parseInt(position[i].charAt(j), 10); if (!isNaN(num)) k += num - 1; } } @@ -624,7 +634,7 @@ export class RococoRules extends ChessRules { static GenRandInitFen(randomness) { if (randomness == 0) { return ( - "91/1rnbkqbnm1/1pppppppp1/91/91/91/91/1PPPPPPPP1/1MNBQKBNR1/91 w 0 -" + "91/1rqnbknqm1/1pppppppp1/91/91/91/91/1PPPPPPPP1/1MQNBKNQR1/91 w 0 -" ); } @@ -712,4 +722,5 @@ export class RococoRules extends ChessRules { if (move.vanish.length > 1 && move.appear[0].p != V.KING) notation += "X"; return notation; } + };