1 import { ChessRules
} from "@/base_rules";
2 import { Avalam2Rules
} from "@/variants/Avalam2";
4 export class Avalam1Rules
extends Avalam2Rules
{
11 if (b
[0] == 'x') return 'x';
12 return ChessRules
.board2fen(b
);
16 if (f
== 'x') return V
.NOTHING
;
17 return ChessRules
.fen2board(f
);
21 if (b
[0] == 'x') return "Omega/nothing";
25 static GenRandInitFen() {
27 "xxBbxxxxx/xBbBbxxxx/xbBbBbBxx/xBbBbBbBb/BbBb1bBbB/" +
28 "bBbBbBbBx/xxBbBbBbx/xxxxbBbBx/xxxxxbBxx w 0"
33 return { x: 9, y: 9 };
36 static OnBoard(x
, y
) {
37 if (!ChessRules
.OnBoard(x
, y
)) return false;
39 case 0: return [2, 3].includes(y
);
40 case 1: return [1, 2, 3, 4].includes(y
);
41 case 2: return [1, 2, 3, 4, 5, 6].includes(y
);
42 case 3: return y
>= 1;
43 case 4: return y
!= 4;
44 case 5: return y
<= 7;
45 case 6: return [2, 3, 4, 5, 6, 7].includes(y
);
46 case 7: return [4, 5, 6, 7].includes(y
);
47 case 8: return [5, 6].includes(y
);
49 return false; //never reached