X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=utils%2FsetupPieces.js;fp=utils%2FsetupPieces.js;h=11af74afd360a7b01af0ec41b169147ce9fe4975;hp=7cd67790caa6b3f9c919907d58646488c670f90d;hb=0cef7bb4f72046ce60db408bfb76103428e2c15a;hpb=c9a20f4f198e1877bd260a610b1692b3d65d0eba diff --git a/utils/setupPieces.js b/utils/setupPieces.js index 7cd6779..11af74a 100644 --- a/utils/setupPieces.js +++ b/utils/setupPieces.js @@ -1,10 +1,10 @@ import {Random} from "/utils/alea.js"; -export class FenUtil = { +export const FenUtil = { // arg o (constraints): "between" with p1 and p2. // "flags", "diffCol": array of pieceType - setupRow(arr, o) { + setupRow: function(arr, o) { let res = JSON.parse(JSON.stringify(arr)); if (o.randomness >= 1) res = Random.shuffle(arr); @@ -51,9 +51,9 @@ export class FenUtil = { } } return {fen: res, flags: flags}; - } + }, - setupPieces(arr, o) { + setupPieces: function(arr, o) { const row1 = FenUtil.setupRow(arr, o); const row2 = o.randomness == 2 ? FenUtil.setupRow(arr, o) : row1; return {