X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAntiking.js;h=1c062bbf04cd039e0e4e450066692130b84d6e51;hb=7ba4a5bc5b64e19a1e7f26aa232d5c50770d07ad;hp=f07f6268e738a4597c49168291c035c787f78ff0;hpb=241bf8f2a9a2c48d793aeb0b1d20207f6371de70;p=vchess.git diff --git a/client/src/variants/Antiking.js b/client/src/variants/Antiking.js index f07f6268..1c062bbf 100644 --- a/client/src/variants/Antiking.js +++ b/client/src/variants/Antiking.js @@ -145,13 +145,25 @@ export const VariantRules = class AntikingRules extends ChessRules { } static get VALUES() { - return Object.assign(ChessRules.VALUES, { a: 1000 }); + return Object.assign( + { a: 1000 }, + ChessRules.VALUES + ); } - static GenRandInitFen() { + static GenRandInitFen(randomness) { + if (!randomness) randomness = 2; + if (randomness == 0) + return "rnbqkbnr/pppppppp/3A4/8/8/3a4/PPPPPPPP/RNBQKBNR w 0 1111 -"; + let pieces = { w: new Array(8), b: new Array(8) }; let antikingPos = { w: -1, b: -1 }; for (let c of ["w", "b"]) { + if (c == 'b' && randomness == 1) { + pieces['b'] = pieces['w']; + break; + } + let positions = ArrayFun.range(8); // Get random squares for bishops, but avoid corners; because,