projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check variants. All OK except Dark (bug), Checkered (missing internal moves stack...
[vchess.git]
/
client
/
src
/
variants
/
Baroque.js
diff --git
a/client/src/variants/Baroque.js
b/client/src/variants/Baroque.js
index
c394257
..
9b5a3cd
100644
(file)
--- a/
client/src/variants/Baroque.js
+++ b/
client/src/variants/Baroque.js
@@
-1,4
+1,8
@@
-class BaroqueRules extends ChessRules
+import { ChessRules, PiPo, Move } from "@/base_rules";
+import { ArrayFun } from "@/utils/array";
+import { randInt } from "@/utils/alea";
+
+export const VariantRules = class BaroqueRules extends ChessRules
{
static get HasFlags() { return false; }
{
static get HasFlags() { return false; }
@@
-548,34
+552,34
@@
class BaroqueRules extends ChessRules
// Shuffle pieces on first and last rank
for (let c of ["w","b"])
{
// Shuffle pieces on first and last rank
for (let c of ["w","b"])
{
- let positions = range(8);
+ let positions =
ArrayFun.
range(8);
// Get random squares for every piece, totally freely
// Get random squares for every piece, totally freely
- let randIndex = rand
om
(8);
+ let randIndex = rand
Int
(8);
const bishop1Pos = positions[randIndex];
positions.splice(randIndex, 1);
const bishop1Pos = positions[randIndex];
positions.splice(randIndex, 1);
- randIndex = rand
om
(7);
+ randIndex = rand
Int
(7);
const bishop2Pos = positions[randIndex];
positions.splice(randIndex, 1);
const bishop2Pos = positions[randIndex];
positions.splice(randIndex, 1);
- randIndex = rand
om
(6);
+ randIndex = rand
Int
(6);
const knight1Pos = positions[randIndex];
positions.splice(randIndex, 1);
const knight1Pos = positions[randIndex];
positions.splice(randIndex, 1);
- randIndex = rand
om
(5);
+ randIndex = rand
Int
(5);
const knight2Pos = positions[randIndex];
positions.splice(randIndex, 1);
const knight2Pos = positions[randIndex];
positions.splice(randIndex, 1);
- randIndex = rand
om
(4);
+ randIndex = rand
Int
(4);
const queenPos = positions[randIndex];
positions.splice(randIndex, 1);
const queenPos = positions[randIndex];
positions.splice(randIndex, 1);
- randIndex = rand
om
(3);
+ randIndex = rand
Int
(3);
const kingPos = positions[randIndex];
positions.splice(randIndex, 1);
const kingPos = positions[randIndex];
positions.splice(randIndex, 1);
- randIndex = rand
om
(2);
+ randIndex = rand
Int
(2);
const rookPos = positions[randIndex];
positions.splice(randIndex, 1);
const immobilizerPos = positions[0];
const rookPos = positions[randIndex];
positions.splice(randIndex, 1);
const immobilizerPos = positions[0];
@@
-592,7
+596,7
@@
class BaroqueRules extends ChessRules
return pieces["b"].join("") +
"/pppppppp/8/8/8/8/PPPPPPPP/" +
pieces["w"].join("").toUpperCase() +
return pieces["b"].join("") +
"/pppppppp/8/8/8/8/PPPPPPPP/" +
pieces["w"].join("").toUpperCase() +
- " w";
+ " w
0
";
}
getNotation(move)
}
getNotation(move)