projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(Hopefully) better (cleaner) authentication mechanism now
[vchess.git]
/
client
/
src
/
variants
/
Shako.js
diff --git
a/client/src/variants/Shako.js
b/client/src/variants/Shako.js
index
c3db279
..
2701f1e
100644
(file)
--- a/
client/src/variants/Shako.js
+++ b/
client/src/variants/Shako.js
@@
-68,7
+68,7
@@
export class ShakoRules extends ChessRules {
}
getPotentialElephantMoves([x, y]) {
}
getPotentialElephantMoves([x, y]) {
- return this.getSlideNJumpMoves([x, y], V.steps[V.ELEPHANT],
"oneStep"
);
+ return this.getSlideNJumpMoves([x, y], V.steps[V.ELEPHANT],
1
);
}
getPotentialCannonMoves([x, y]) {
}
getPotentialCannonMoves([x, y]) {
@@
-115,7
+115,7
@@
export class ShakoRules extends ChessRules {
isAttackedByElephant(sq, color) {
return (
this.isAttackedBySlideNJump(
isAttackedByElephant(sq, color) {
return (
this.isAttackedBySlideNJump(
- sq, color, V.ELEPHANT, V.steps[V.ELEPHANT],
"oneStep"
+ sq, color, V.ELEPHANT, V.steps[V.ELEPHANT],
1
)
);
}
)
);
}
@@
-185,8
+185,8
@@
export class ShakoRules extends ChessRules {
return 2;
}
return 2;
}
- static GenRandInitFen(
randomnes
s) {
- if (randomness == 0) {
+ static GenRandInitFen(
option
s) {
+ if (
options.
randomness == 0) {
return (
"c8c/ernbqkbnre/pppppppppp/91/91/91/91/PPPPPPPPPP/ERNBQKBNRE/C8C " +
"w 0 bibi -"
return (
"c8c/ernbqkbnre/pppppppppp/91/91/91/91/PPPPPPPPPP/ERNBQKBNRE/C8C " +
"w 0 bibi -"
@@
-197,7
+197,7
@@
export class ShakoRules extends ChessRules {
let flags = "";
// Shuffle pieces on second (and before-last rank if randomness == 2)
for (let c of ["w", "b"]) {
let flags = "";
// Shuffle pieces on second (and before-last rank if randomness == 2)
for (let c of ["w", "b"]) {
- if (c == 'b' && randomness == 1) {
+ if (c == 'b' &&
options.
randomness == 1) {
pieces['b'] = pieces['w'];
flags += flags;
break;
pieces['b'] = pieces['w'];
flags += flags;
break;