projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix last refactoring. Ready to add variants
[xogo.git]
/
variants
/
Suction
/
class.js
diff --git
a/variants/Suction/class.js
b/variants/Suction/class.js
index
dbaefa0
..
a66855d
100644
(file)
--- a/
variants/Suction/class.js
+++ b/
variants/Suction/class.js
@@
-44,9
+44,12
@@
export default class SuctionRules extends ChessRules {
genRandInitFen(seed) {
const options = Object.assign({mode: "suicide"}, this.options);
const gr = new GiveawayRules({options: options, genFenOnly: true});
genRandInitFen(seed) {
const options = Object.assign({mode: "suicide"}, this.options);
const gr = new GiveawayRules({options: options, genFenOnly: true});
+ const baseFen = gr.genRandInitFen(seed);
// Add empty cmove:
// Add empty cmove:
- return (
- gr.genRandInitFen(seed).slice(0, -17) + '{"enpassant":"-","cmove":"-"}');
+ const fenParts = baseFen.split(" ");
+ let others = JSON.parse(fenParts[3]);
+ others["cmove"] = "-";
+ return fenParts.slice(0, 3).join(" ") + " " + JSON.stringify(others);
}
getFen() {
}
getFen() {