0e6a3e567ae212a6f2e9d86b85caf0e6275ea91a
1 import ChessRules
from "/base_rules.js";
2 import AbstractAntikingRules
from "/variants/AbstractAntiking.js";
3 import { Random
} from "/utils/alea.js";
5 export class Antiking2Rules
extends AbstractAntikingRules
{
8 return Object
.assign({'A': AbstractAntikingRules
}, ChessRules
.Aliases
);
11 static get Options() {
13 styles: A
.Options
.styles
.concat("cylinder")
17 genRandInitFen(seed
) {
18 const baseFen
= super.genRandInitFen(seed
);
19 // Just add an antiking on 3rd ranks
21 if (this.options
.randomness
>= 1) {
22 akPos
[0] = Random
.randInt(this.size
.y
);
23 if (this.options
.randomness
== 2)
24 akPos
[1] = Random
.randInt(this.size
.y
);
28 const whiteLine
= (akPos
[0] > 0 ? akPos
[0] : "") + 'A' + (akPos
< this.size
.y
- 1 ? ...);
30 return baseFen
.replace(...)