X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=utils%2FsetupPieces.js;fp=utils%2FsetupPieces.js;h=7cd67790caa6b3f9c919907d58646488c670f90d;hb=7c03823594cef3ce6e8da7ac1d7d3504c73695a9;hp=988903e5a1083a068ff77ac234de7e09c9343b77;hpb=0adfbdb55452c79532875beb8eed61b1ed4c6cd2;p=xogo.git diff --git a/utils/setupPieces.js b/utils/setupPieces.js index 988903e..7cd6779 100644 --- a/utils/setupPieces.js +++ b/utils/setupPieces.js @@ -5,7 +5,7 @@ export class FenUtil = { // arg o (constraints): "between" with p1 and p2. // "flags", "diffCol": array of pieceType setupRow(arr, o) { - let res = arr; + let res = JSON.parse(JSON.stringify(arr)); if (o.randomness >= 1) res = Random.shuffle(arr); let flags = ""; @@ -57,9 +57,10 @@ export class FenUtil = { const row1 = FenUtil.setupRow(arr, o); const row2 = o.randomness == 2 ? FenUtil.setupRow(arr, o) : row1; return { - w: row1.fen.toUpperCase, + w: row1.fen, b: row2.fen, flags: row1.flags + row2.flags }; } + };