projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix and complete Apocalypse variant
[vchess.git]
/
client
/
src
/
variants
/
Wildebeest.js
diff --git
a/client/src/variants/Wildebeest.js
b/client/src/variants/Wildebeest.js
index
f4e3b83
..
fe2a0c0
100644
(file)
--- a/
client/src/variants/Wildebeest.js
+++ b/
client/src/variants/Wildebeest.js
@@
-2,7
+2,7
@@
import { ChessRules } from "@/base_rules";
import { ArrayFun } from "@/utils/array";
import { sample, randInt } from "@/utils/alea";
import { ArrayFun } from "@/utils/array";
import { sample, randInt } from "@/utils/alea";
-export c
onst VariantRules = c
lass WildebeestRules extends ChessRules {
+export class WildebeestRules extends ChessRules {
static get size() {
return { x: 10, y: 11 };
}
static get size() {
return { x: 10, y: 11 };
}
@@
-20,7
+20,9
@@
export const VariantRules = class WildebeestRules extends ChessRules {
static get steps() {
return Object.assign(
static get steps() {
return Object.assign(
- ChessRules.steps, //add camel moves:
+ {},
+ ChessRules.steps,
+ // Add camel moves:
{
c: [
[-3, -1],
{
c: [
[-3, -1],
@@
-225,10
+227,7
@@
export const VariantRules = class WildebeestRules extends ChessRules {
}
getCurrentScore() {
}
getCurrentScore() {
- if (this.atLeastOneMove())
- // game not over
- return "*";
-
+ if (this.atLeastOneMove()) return "*";
// No valid move: game is lost (stalemate is a win)
return this.turn == "w" ? "0-1" : "1-0";
}
// No valid move: game is lost (stalemate is a win)
return this.turn == "w" ? "0-1" : "1-0";
}
@@
-247,9
+246,9
@@
export const VariantRules = class WildebeestRules extends ChessRules {
static GenRandInitFen(randomness) {
if (!randomness) randomness = 2;
if (randomness == 0)
static GenRandInitFen(randomness) {
if (!randomness) randomness = 2;
if (randomness == 0)
- return "rnccwkqbbnr/ppppppppppp/
11/11/11/11/11/11
/PPPPPPPPPPP/RNBBQKWCCNR w 0 akak -";
+ return "rnccwkqbbnr/ppppppppppp/
92/92/92/92/92/92
/PPPPPPPPPPP/RNBBQKWCCNR w 0 akak -";
- let pieces = { w: new Array(1
0), b: new Array(10
) };
+ let pieces = { w: new Array(1
1), b: new Array(11
) };
let flags = "";
for (let c of ["w", "b"]) {
if (c == 'b' && randomness == 1) {
let flags = "";
for (let c of ["w", "b"]) {
if (c == 'b' && randomness == 1) {
@@
-314,7
+313,7
@@
export const VariantRules = class WildebeestRules extends ChessRules {
}
return (
pieces["b"].join("") +
}
return (
pieces["b"].join("") +
- "/ppppppppppp/
11/11/11/11/11/11
/PPPPPPPPPPP/" +
+ "/ppppppppppp/
92/92/92/92/92/92
/PPPPPPPPPPP/" +
pieces["w"].join("").toUpperCase() +
" w 0 " + flags + " -"
);
pieces["w"].join("").toUpperCase() +
" w 0 " + flags + " -"
);