projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix FenUtil
[xogo.git]
/
utils
/
setupPieces.js
diff --git
a/utils/setupPieces.js
b/utils/setupPieces.js
index
7cd6779
..
11af74a
100644
(file)
--- a/
utils/setupPieces.js
+++ b/
utils/setupPieces.js
@@
-1,10
+1,10
@@
import {Random} from "/utils/alea.js";
import {Random} from "/utils/alea.js";
-export c
lass
FenUtil = {
+export c
onst
FenUtil = {
// arg o (constraints): "between" with p1 and p2.
// "flags", "diffCol": array of pieceType
// 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);
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};
}
}
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 {
const row1 = FenUtil.setupRow(arr, o);
const row2 = o.randomness == 2 ? FenUtil.setupRow(arr, o) : row1;
return {