Code reorganization
[vchess.git] / client / src / variants / Losers.js
similarity index 94%
rename from client/client_OLD/javascripts/variants/Losers.js
rename to client/src/variants/Losers.js
index 33c8109..e1fb54c 100644 (file)
@@ -133,33 +133,33 @@ class LosersRules extends ChessRules
                // Shuffle pieces on first and last rank
                for (let c of ["w","b"])
                {
-                       let positions = _.range(8);
+                       let positions = range(8);
 
                        // Get random squares for bishops
-                       let randIndex = 2 * _.random(3);
+                       let randIndex = 2 * random(4);
                        let bishop1Pos = positions[randIndex];
                        // The second bishop must be on a square of different color
-                       let randIndex_tmp = 2 * _.random(3) + 1;
+                       let randIndex_tmp = 2 * random(4) + 1;
                        let bishop2Pos = positions[randIndex_tmp];
                        // Remove chosen squares
                        positions.splice(Math.max(randIndex,randIndex_tmp), 1);
                        positions.splice(Math.min(randIndex,randIndex_tmp), 1);
 
                        // Get random squares for knights
-                       randIndex = _.random(5);
+                       randIndex = random(6);
                        let knight1Pos = positions[randIndex];
                        positions.splice(randIndex, 1);
-                       randIndex = _.random(4);
+                       randIndex = random(5);
                        let knight2Pos = positions[randIndex];
                        positions.splice(randIndex, 1);
 
                        // Get random square for queen
-                       randIndex = _.random(3);
+                       randIndex = random(4);
                        let queenPos = positions[randIndex];
                        positions.splice(randIndex, 1);
 
                        // Random square for king (no castle)
-                       randIndex = _.random(2);
+                       randIndex = random(3);
                        let kingPos = positions[randIndex];
                        positions.splice(randIndex, 1);