import { ArrayFun } from "@/utils/array";
// NOTE: alternative implementation, probably cleaner = use only 1 board
import { ArrayFun } from "@/utils/array";
// NOTE: alternative implementation, probably cleaner = use only 1 board
super.setOtherVariables(fen);
const rows = V.ParseFen(fen).position.split("/");
if (this.kingPos["w"][0] < 0 || this.kingPos["b"][0] < 0) {
super.setOtherVariables(fen);
const rows = V.ParseFen(fen).position.split("/");
if (this.kingPos["w"][0] < 0 || this.kingPos["b"][0] < 0) {
for (let i = 0; i < rows.length; i++) {
let k = 0; //column index on board
for (let j = 0; j < rows[i].length; j++) {
for (let i = 0; i < rows.length; i++) {
let k = 0; //column index on board
for (let j = 0; j < rows[i].length; j++) {
getPotentialMovesFrom([x, y], sideBoard) {
const pieces = Object.keys(V.ALICE_CODES);
const codes = Object.keys(V.ALICE_PIECES);
getPotentialMovesFrom([x, y], sideBoard) {
const pieces = Object.keys(V.ALICE_CODES);
const codes = Object.keys(V.ALICE_PIECES);
if (m.appear.length == 2) {
// Castle: appear[i] must be an empty square on the other board
for (let psq of m.appear) {
if (m.appear.length == 2) {
// Castle: appear[i] must be an empty square on the other board
for (let psq of m.appear) {
const pieces = Object.keys(V.ALICE_CODES);
const kp = this.kingPos[color];
const mirrorSide = pieces.includes(this.getPiece(kp[0], kp[1])) ? 1 : 2;
const pieces = Object.keys(V.ALICE_CODES);
const kp = this.kingPos[color];
const mirrorSide = pieces.includes(this.getPiece(kp[0], kp[1])) ? 1 : 2;