projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update Cwda - RR pieces
[vchess.git]
/
client
/
src
/
variants
/
Tencubed.js
diff --git
a/client/src/variants/Tencubed.js
b/client/src/variants/Tencubed.js
index
99bff13
..
11270b2
100644
(file)
--- a/
client/src/variants/Tencubed.js
+++ b/
client/src/variants/Tencubed.js
@@
-3,6
+3,7
@@
import { ArrayFun } from "@/utils/array";
import { shuffle } from "@/utils/alea";
export class TencubedRules extends ChessRules {
import { shuffle } from "@/utils/alea";
export class TencubedRules extends ChessRules {
+
static get PawnSpecs() {
return Object.assign(
{},
static get PawnSpecs() {
return Object.assign(
{},
@@
-59,8
+60,6
@@
export class TencubedRules extends ChessRules {
static get steps() {
return Object.assign(
static get steps() {
return Object.assign(
- {},
- ChessRules.steps,
{
w: [
[-3, -1],
{
w: [
[-3, -1],
@@
-90,12
+89,13
@@
export class TencubedRules extends ChessRules {
[2, 0],
[0, 2]
]
[2, 0],
[0, 2]
]
- }
+ },
+ ChessRules.steps,
);
}
);
}
- static GenRandInitFen(
randomnes
s) {
- if (randomness == 0) {
+ static GenRandInitFen(
option
s) {
+ if (
options.
randomness == 0) {
return (
"2cwamwc2/1rnbqkbnr1/pppppppppp/91/91/" +
"91/91/PPPPPPPPPP/1RNBQKBNR1/2CWAMWC2/ " +
return (
"2cwamwc2/1rnbqkbnr1/pppppppppp/91/91/" +
"91/91/PPPPPPPPPP/1RNBQKBNR1/2CWAMWC2/ " +
@@
-103,7
+103,7
@@
export class TencubedRules extends ChessRules {
);
}
);
}
- const baseFen = V.ParseFen(ChessRules.GenRandInitFen(
randomnes
s));
+ const baseFen = V.ParseFen(ChessRules.GenRandInitFen(
option
s));
const positionParts = baseFen.position.split("/");
const bFen = (
"1" + positionParts[0] +
const positionParts = baseFen.position.split("/");
const bFen = (
"1" + positionParts[0] +
@@
-163,22
+163,22
@@
export class TencubedRules extends ChessRules {
getPotentialMarshallMoves(sq) {
return this.getSlideNJumpMoves(sq, V.steps[V.ROOK]).concat(
getPotentialMarshallMoves(sq) {
return this.getSlideNJumpMoves(sq, V.steps[V.ROOK]).concat(
- this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT],
"oneStep"
)
+ this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT],
1
)
);
}
getPotentialArchbishopMoves(sq) {
return this.getSlideNJumpMoves(sq, V.steps[V.BISHOP]).concat(
);
}
getPotentialArchbishopMoves(sq) {
return this.getSlideNJumpMoves(sq, V.steps[V.BISHOP]).concat(
- this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT],
"oneStep"
)
+ this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT],
1
)
);
}
getPotentialChampionMoves(sq) {
);
}
getPotentialChampionMoves(sq) {
- return this.getSlideNJumpMoves(sq, V.steps[V.CHAMPION],
"oneStep"
);
+ return this.getSlideNJumpMoves(sq, V.steps[V.CHAMPION],
1
);
}
getPotentialWizardMoves(sq) {
}
getPotentialWizardMoves(sq) {
- return this.getSlideNJumpMoves(sq, V.steps[V.WIZARD],
"oneStep"
);
+ return this.getSlideNJumpMoves(sq, V.steps[V.WIZARD],
1
);
}
isAttacked(sq, color) {
}
isAttacked(sq, color) {
@@
-194,41
+194,28
@@
export class TencubedRules extends ChessRules {
isAttackedByMarshall(sq, color) {
return (
this.isAttackedBySlideNJump(sq, color, V.MARSHALL, V.steps[V.ROOK]) ||
isAttackedByMarshall(sq, color) {
return (
this.isAttackedBySlideNJump(sq, color, V.MARSHALL, V.steps[V.ROOK]) ||
- this.isAttackedBySlideNJump(
- sq,
- color,
- V.MARSHALL,
- V.steps[V.KNIGHT],
- "oneStep"
- )
+ this.isAttackedBySlideNJump(sq, color, V.MARSHALL, V.steps[V.KNIGHT], 1)
);
}
isAttackedByArchbishop(sq, color) {
return (
);
}
isAttackedByArchbishop(sq, color) {
return (
- this.isAttackedBySlideNJump(sq, color, V.CARDINAL, V.steps[V.BISHOP]) ||
this.isAttackedBySlideNJump(
this.isAttackedBySlideNJump(
- sq,
- color,
- V.CARDINAL,
- V.steps[V.KNIGHT],
- "oneStep"
- )
+ sq, color, V.ARCHBISHOP, V.steps[V.BISHOP])
+ ||
+ this.isAttackedBySlideNJump(
+ sq, color, V.ARCHBISHOP, V.steps[V.KNIGHT], 1)
);
}
isAttackedByWizard(sq, color) {
);
}
isAttackedByWizard(sq, color) {
- return (
- this.isAttackedBySlideNJump(
- sq, color, V.WIZARD, V.steps[V.WIZARD], "oneStep")
- );
+ return this.isAttackedBySlideNJump(
+ sq, color, V.WIZARD, V.steps[V.WIZARD], 1);
}
isAttackedByChampion(sq, color) {
}
isAttackedByChampion(sq, color) {
- return (
- this.isAttackedBySlideNJump(
- sq, color, V.CHAMPION, V.steps[V.CHAMPION], "oneStep")
- );
+ return this.isAttackedBySlideNJump(
+ sq, color, V.CHAMPION, V.steps[V.CHAMPION], 1);
}
static get SEARCH_DEPTH() {
}
static get SEARCH_DEPTH() {
@@
-237,9
+224,14
@@
export class TencubedRules extends ChessRules {
static get VALUES() {
return Object.assign(
static get VALUES() {
return Object.assign(
- {},
- ChessRules.VALUES,
- { c: 4, w: 3, a: 6, m: 8 }
+ {
+ c: 4,
+ w: 3,
+ a: 6,
+ m: 8
+ },
+ ChessRules.VALUES
);
}
);
}
+
};
};