projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Experimental symmetric randomness + deterministic option
[vchess.git]
/
client
/
src
/
variants
/
Grand.js
diff --git
a/client/src/variants/Grand.js
b/client/src/variants/Grand.js
index
d3659af
..
c910dd8
100644
(file)
--- a/
client/src/variants/Grand.js
+++ b/
client/src/variants/Grand.js
@@
-316,10
+316,21
@@
export const VariantRules = class GrandRules extends ChessRules {
return 2;
}
return 2;
}
- static GenRandInitFen() {
+ static GenRandInitFen(randomness) {
+ if (!randomness) randomness = 2;
+ if (randomness == 0) {
+ return "rnbqkmcbnr/pppppppppp/10/10/10/10/10/10/PPPPPPPPPP/RNBQKMCBNR " +
+ "w 0 1111 - 00000000000000";
+ }
+
let pieces = { w: new Array(10), b: new Array(10) };
// Shuffle pieces on first and last rank
for (let c of ["w", "b"]) {
let pieces = { w: new Array(10), b: new Array(10) };
// Shuffle pieces on first and last rank
for (let c of ["w", "b"]) {
+ if (c == 'b' && randomness == 1) {
+ pieces['b'] = pieces['w'];
+ break;
+ }
+
let positions = ArrayFun.range(10);
// Get random squares for bishops
let positions = ArrayFun.range(10);
// Get random squares for bishops