X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FWildebeest.js;fp=client%2Fclient_OLD%2Fjavascripts%2Fvariants%2FWildebeest.js;h=509586a9a52f60765905944dfb76816701445d2f;hb=8d61fc4ab7373b4a576f3f9108cdf7768ae27096;hp=cb95318b64fe2c484663edfae972e1808d4f13af;hpb=760865ac92508676c0047b84c5ba3e12d41d7c20;p=vchess.git diff --git a/client/client_OLD/javascripts/variants/Wildebeest.js b/client/src/variants/Wildebeest.js similarity index 95% rename from client/client_OLD/javascripts/variants/Wildebeest.js rename to client/src/variants/Wildebeest.js index cb95318b..509586a9 100644 --- a/client/client_OLD/javascripts/variants/Wildebeest.js +++ b/client/src/variants/Wildebeest.js @@ -231,14 +231,14 @@ class WildebeestRules extends ChessRules let pieces = { "w": new Array(10), "b": new Array(10) }; for (let c of ["w","b"]) { - let positions = _.range(11); + let positions = range(11); // Get random squares for bishops + camels (different colors) - let randIndexes = _.sample(_.range(6), 2).map(i => { return 2*i; }); + let randIndexes = sample(range(6), 2).map(i => { return 2*i; }); let bishop1Pos = positions[randIndexes[0]]; let camel1Pos = positions[randIndexes[1]]; // The second bishop (camel) must be on a square of different color - let randIndexes_tmp = _.sample(_.range(5), 2).map(i => { return 2*i+1; }); + let randIndexes_tmp = sample(range(5), 2).map(i => { return 2*i+1; }); let bishop2Pos = positions[randIndexes_tmp[0]]; let camel2Pos = positions[randIndexes_tmp[1]]; for (let idx of randIndexes.concat(randIndexes_tmp) @@ -247,19 +247,19 @@ class WildebeestRules extends ChessRules positions.splice(idx, 1); } - let randIndex = _.random(6); + let randIndex = random(7); let knight1Pos = positions[randIndex]; positions.splice(randIndex, 1); - randIndex = _.random(5); + randIndex = random(6); let knight2Pos = positions[randIndex]; positions.splice(randIndex, 1); - randIndex = _.random(4); + randIndex = random(5); let queenPos = positions[randIndex]; positions.splice(randIndex, 1); // Random square for wildebeest - randIndex = _.random(3); + randIndex = random(4); let wildebeestPos = positions[randIndex]; positions.splice(randIndex, 1);