gigachess 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +183 -0
- package/dist/attacks.d.ts +40 -0
- package/dist/attacks.d.ts.map +1 -0
- package/dist/attacks.js +389 -0
- package/dist/bishopMagicBlob.d.ts +2 -0
- package/dist/bishopMagicBlob.d.ts.map +1 -0
- package/dist/bishopMagicBlob.js +11 -0
- package/dist/board.d.ts +73 -0
- package/dist/board.d.ts.map +1 -0
- package/dist/board.js +237 -0
- package/dist/chess.d.ts +215 -0
- package/dist/chess.d.ts.map +1 -0
- package/dist/chess.js +1453 -0
- package/dist/chess960.d.ts +10 -0
- package/dist/chess960.d.ts.map +1 -0
- package/dist/chess960.js +18 -0
- package/dist/chessops/board.d.ts +49 -0
- package/dist/chessops/board.d.ts.map +1 -0
- package/dist/chessops/board.js +138 -0
- package/dist/chessops/chess.d.ts +104 -0
- package/dist/chessops/chess.d.ts.map +1 -0
- package/dist/chessops/chess.js +435 -0
- package/dist/chessops/compat.d.ts +19 -0
- package/dist/chessops/compat.d.ts.map +1 -0
- package/dist/chessops/compat.js +25 -0
- package/dist/chessops/convert.d.ts +42 -0
- package/dist/chessops/convert.d.ts.map +1 -0
- package/dist/chessops/convert.js +114 -0
- package/dist/chessops/debug.d.ts +17 -0
- package/dist/chessops/debug.d.ts.map +1 -0
- package/dist/chessops/debug.js +67 -0
- package/dist/chessops/fen.d.ts +28 -0
- package/dist/chessops/fen.d.ts.map +1 -0
- package/dist/chessops/fen.js +74 -0
- package/dist/chessops/fenInternal.d.ts +15 -0
- package/dist/chessops/fenInternal.d.ts.map +1 -0
- package/dist/chessops/fenInternal.js +42 -0
- package/dist/chessops/index.d.ts +12 -0
- package/dist/chessops/index.d.ts.map +1 -0
- package/dist/chessops/index.js +17 -0
- package/dist/chessops/san.d.ts +7 -0
- package/dist/chessops/san.d.ts.map +1 -0
- package/dist/chessops/san.js +33 -0
- package/dist/chessops/setup.d.ts +64 -0
- package/dist/chessops/setup.d.ts.map +1 -0
- package/dist/chessops/setup.js +158 -0
- package/dist/chessops/squareSet.d.ts +48 -0
- package/dist/chessops/squareSet.d.ts.map +1 -0
- package/dist/chessops/squareSet.js +192 -0
- package/dist/chessops/transform.d.ts +12 -0
- package/dist/chessops/transform.d.ts.map +1 -0
- package/dist/chessops/transform.js +53 -0
- package/dist/chessops/types.d.ts +47 -0
- package/dist/chessops/types.d.ts.map +1 -0
- package/dist/chessops/types.js +12 -0
- package/dist/chessops/util.d.ts +19 -0
- package/dist/chessops/util.d.ts.map +1 -0
- package/dist/chessops/util.js +52 -0
- package/dist/chesstree.d.ts +143 -0
- package/dist/chesstree.d.ts.map +1 -0
- package/dist/chesstree.js +514 -0
- package/dist/core.d.ts +10 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +11 -0
- package/dist/fen.d.ts +10 -0
- package/dist/fen.d.ts.map +1 -0
- package/dist/fen.js +600 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/packedMove.d.ts +31 -0
- package/dist/packedMove.d.ts.map +1 -0
- package/dist/packedMove.js +88 -0
- package/dist/pgn.d.ts +24 -0
- package/dist/pgn.d.ts.map +1 -0
- package/dist/pgn.js +361 -0
- package/dist/rookMagicBlob.d.ts +2 -0
- package/dist/rookMagicBlob.d.ts.map +1 -0
- package/dist/rookMagicBlob.js +11 -0
- package/dist/san.d.ts +6 -0
- package/dist/san.d.ts.map +1 -0
- package/dist/san.js +484 -0
- package/dist/squareSet.d.ts +48 -0
- package/dist/squareSet.d.ts.map +1 -0
- package/dist/squareSet.js +154 -0
- package/dist/types.d.ts +147 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +88 -0
- package/dist/util.d.ts +11 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +59 -0
- package/dist/zobrist.d.ts +45 -0
- package/dist/zobrist.d.ts.map +1 -0
- package/dist/zobrist.js +271 -0
- package/dist/zobristBlob.d.ts +2 -0
- package/dist/zobristBlob.d.ts.map +1 -0
- package/dist/zobristBlob.js +11 -0
- package/package.json +135 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
export class SquareSet {
|
|
2
|
+
constructor(lo, hi) {
|
|
3
|
+
// baseline stores lo/hi as SIGNED int32 — coerce identically so `.hi`
|
|
4
|
+
// reads compare equal to baseline (e.g. full() is -1/-1, not 0xffffffff).
|
|
5
|
+
this.lo = lo | 0;
|
|
6
|
+
this.hi = hi | 0;
|
|
7
|
+
}
|
|
8
|
+
static fromSquare(square) {
|
|
9
|
+
return square < 32 ? new SquareSet(1 << square, 0) : new SquareSet(0, 1 << (square - 32));
|
|
10
|
+
}
|
|
11
|
+
static fromRank(rank) {
|
|
12
|
+
return new SquareSet(0xff << (8 * rank), 0);
|
|
13
|
+
}
|
|
14
|
+
static fromFile(file) {
|
|
15
|
+
return new SquareSet(0x01010101 << file, 0x01010101 << file);
|
|
16
|
+
}
|
|
17
|
+
static empty() {
|
|
18
|
+
return new SquareSet(0, 0);
|
|
19
|
+
}
|
|
20
|
+
static full() {
|
|
21
|
+
return new SquareSet(0xffffffff, 0xffffffff);
|
|
22
|
+
}
|
|
23
|
+
static corners() {
|
|
24
|
+
return new SquareSet(0x81, 0x81000000);
|
|
25
|
+
}
|
|
26
|
+
static center() {
|
|
27
|
+
return new SquareSet(0x18000000, 0x18); // d4, e4, d5, e5
|
|
28
|
+
}
|
|
29
|
+
static backranks() {
|
|
30
|
+
return new SquareSet(0xff, 0xff000000); // a1-h1 + a8-h8
|
|
31
|
+
}
|
|
32
|
+
static backrank(color) {
|
|
33
|
+
return color === "white" ? new SquareSet(0xff, 0) : new SquareSet(0, 0xff000000);
|
|
34
|
+
}
|
|
35
|
+
static lightSquares() {
|
|
36
|
+
return new SquareSet(0x55aa55aa, 0x55aa55aa);
|
|
37
|
+
}
|
|
38
|
+
static darkSquares() {
|
|
39
|
+
return new SquareSet(0xaa55aa55, 0xaa55aa55);
|
|
40
|
+
}
|
|
41
|
+
complement() {
|
|
42
|
+
return new SquareSet(~this.lo, ~this.hi);
|
|
43
|
+
}
|
|
44
|
+
xor(other) {
|
|
45
|
+
return new SquareSet(this.lo ^ other.lo, this.hi ^ other.hi);
|
|
46
|
+
}
|
|
47
|
+
union(other) {
|
|
48
|
+
return new SquareSet(this.lo | other.lo, this.hi | other.hi);
|
|
49
|
+
}
|
|
50
|
+
intersect(other) {
|
|
51
|
+
return new SquareSet(this.lo & other.lo, this.hi & other.hi);
|
|
52
|
+
}
|
|
53
|
+
diff(other) {
|
|
54
|
+
return new SquareSet(this.lo & ~other.lo, this.hi & ~other.hi);
|
|
55
|
+
}
|
|
56
|
+
intersects(other) {
|
|
57
|
+
return (this.hi & other.hi) !== 0 || (this.lo & other.lo) !== 0;
|
|
58
|
+
}
|
|
59
|
+
isDisjoint(other) {
|
|
60
|
+
return !this.intersects(other);
|
|
61
|
+
}
|
|
62
|
+
supersetOf(other) {
|
|
63
|
+
return other.subsetOf(this);
|
|
64
|
+
}
|
|
65
|
+
subsetOf(other) {
|
|
66
|
+
return (this.lo & ~other.lo) === 0 && (this.hi & ~other.hi) === 0;
|
|
67
|
+
}
|
|
68
|
+
shr64(shift) {
|
|
69
|
+
if (shift === 0)
|
|
70
|
+
return this;
|
|
71
|
+
if (shift >= 64)
|
|
72
|
+
return SquareSet.empty();
|
|
73
|
+
if (shift >= 32)
|
|
74
|
+
return new SquareSet(this.hi >>> (shift - 32), 0);
|
|
75
|
+
return new SquareSet((this.lo >>> shift) | (this.hi << (32 - shift)), this.hi >>> shift);
|
|
76
|
+
}
|
|
77
|
+
shl64(shift) {
|
|
78
|
+
if (shift === 0)
|
|
79
|
+
return this;
|
|
80
|
+
if (shift >= 64)
|
|
81
|
+
return SquareSet.empty();
|
|
82
|
+
if (shift >= 32)
|
|
83
|
+
return new SquareSet(0, this.lo << (shift - 32));
|
|
84
|
+
return new SquareSet(this.lo << shift, (this.hi << shift) | (this.lo >>> (32 - shift)));
|
|
85
|
+
}
|
|
86
|
+
bswap64() {
|
|
87
|
+
const b = (x) => ((x >>> 24) & 0xff) | ((x >>> 8) & 0xff00) | ((x << 8) & 0xff0000) | ((x << 24) & 0xff000000);
|
|
88
|
+
return new SquareSet(b(this.hi), b(this.lo));
|
|
89
|
+
}
|
|
90
|
+
rbit64() {
|
|
91
|
+
// reverse all 64 bits
|
|
92
|
+
const lo = this.lo >>> 0, hi = this.hi >>> 0;
|
|
93
|
+
let outLo = 0, outHi = 0;
|
|
94
|
+
for (let i = 0; i < 32; i++) {
|
|
95
|
+
if ((lo >>> i) & 1)
|
|
96
|
+
outHi = (outHi | (1 << (31 - i))) >>> 0;
|
|
97
|
+
if ((hi >>> i) & 1)
|
|
98
|
+
outLo = (outLo | (1 << (31 - i))) >>> 0;
|
|
99
|
+
}
|
|
100
|
+
return new SquareSet(outLo, outHi);
|
|
101
|
+
}
|
|
102
|
+
minus64(other) {
|
|
103
|
+
// 64-bit integer subtraction a - b (signed representation, baseline-exact)
|
|
104
|
+
const lo = this.lo - other.lo;
|
|
105
|
+
const hi = this.hi - other.hi - (this.lo < other.lo ? 1 : 0);
|
|
106
|
+
return new SquareSet(lo, hi);
|
|
107
|
+
}
|
|
108
|
+
equals(other) {
|
|
109
|
+
return this.lo === other.lo && this.hi === other.hi;
|
|
110
|
+
}
|
|
111
|
+
size() {
|
|
112
|
+
// unsigned popcount (lo/hi may hold signed int32 representations)
|
|
113
|
+
let v = this.lo >>> 0;
|
|
114
|
+
v = v - ((v >>> 1) & 0x55555555);
|
|
115
|
+
v = (v & 0x33333333) + ((v >>> 2) & 0x33333333);
|
|
116
|
+
let n = ((v + (v >>> 4)) & 0x0f0f0f0f) % 255;
|
|
117
|
+
let w = this.hi >>> 0;
|
|
118
|
+
w = w - ((w >>> 1) & 0x55555555);
|
|
119
|
+
w = (w & 0x33333333) + ((w >>> 2) & 0x33333333);
|
|
120
|
+
n += ((w + (w >>> 4)) & 0x0f0f0f0f) % 255;
|
|
121
|
+
return n;
|
|
122
|
+
}
|
|
123
|
+
isEmpty() {
|
|
124
|
+
return this.lo === 0 && this.hi === 0;
|
|
125
|
+
}
|
|
126
|
+
nonEmpty() {
|
|
127
|
+
return !this.isEmpty();
|
|
128
|
+
}
|
|
129
|
+
has(square) {
|
|
130
|
+
return square < 32 ? ((this.lo >>> square) & 1) !== 0 : ((this.hi >>> (square - 32)) & 1) !== 0;
|
|
131
|
+
}
|
|
132
|
+
set(square, on) {
|
|
133
|
+
return on ? this.with(square) : this.without(square);
|
|
134
|
+
}
|
|
135
|
+
with(square) {
|
|
136
|
+
return square < 32
|
|
137
|
+
? new SquareSet(this.lo | (1 << square), this.hi)
|
|
138
|
+
: new SquareSet(this.lo, this.hi | (1 << (square - 32)));
|
|
139
|
+
}
|
|
140
|
+
without(square) {
|
|
141
|
+
return square < 32
|
|
142
|
+
? new SquareSet(this.lo & ~(1 << square), this.hi)
|
|
143
|
+
: new SquareSet(this.lo, this.hi & ~(1 << (square - 32)));
|
|
144
|
+
}
|
|
145
|
+
toggle(square) {
|
|
146
|
+
return square < 32
|
|
147
|
+
? new SquareSet(this.lo ^ (1 << square), this.hi)
|
|
148
|
+
: new SquareSet(this.lo, this.hi ^ (1 << (square - 32)));
|
|
149
|
+
}
|
|
150
|
+
last() {
|
|
151
|
+
if (this.hi !== 0)
|
|
152
|
+
return 32 + (31 - Math.clz32(this.hi));
|
|
153
|
+
if (this.lo !== 0)
|
|
154
|
+
return 31 - Math.clz32(this.lo);
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
first() {
|
|
158
|
+
if (this.lo !== 0)
|
|
159
|
+
return 31 - Math.clz32((this.lo & -this.lo) >>> 0);
|
|
160
|
+
if (this.hi !== 0)
|
|
161
|
+
return 32 + (31 - Math.clz32((this.hi & -this.hi) >>> 0));
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
withoutFirst() {
|
|
165
|
+
const first = this.first();
|
|
166
|
+
return first === undefined ? this : this.without(first);
|
|
167
|
+
}
|
|
168
|
+
moreThanOne() {
|
|
169
|
+
return (this.hi !== 0 && this.lo !== 0) || ((this.lo & (this.lo - 1)) >>> 0) !== 0 || ((this.hi & (this.hi - 1)) >>> 0) !== 0;
|
|
170
|
+
}
|
|
171
|
+
singleSquare() {
|
|
172
|
+
return this.moreThanOne() ? undefined : this.first();
|
|
173
|
+
}
|
|
174
|
+
*[Symbol.iterator]() {
|
|
175
|
+
let lo = this.lo, hi = this.hi;
|
|
176
|
+
while (lo !== 0) {
|
|
177
|
+
const lsb = (lo & -lo) >>> 0;
|
|
178
|
+
yield 31 - Math.clz32(lsb);
|
|
179
|
+
lo = (lo ^ lsb) >>> 0;
|
|
180
|
+
}
|
|
181
|
+
while (hi !== 0) {
|
|
182
|
+
const lsb = (hi & -hi) >>> 0;
|
|
183
|
+
yield 32 + (31 - Math.clz32(lsb));
|
|
184
|
+
hi = (hi ^ lsb) >>> 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
*reversed() {
|
|
188
|
+
for (let s = 63; s >= 0; s--)
|
|
189
|
+
if (this.has(s))
|
|
190
|
+
yield s;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Board } from "./board.js";
|
|
2
|
+
/**
|
|
3
|
+
* Vertical mirror + color swap: the position seen from the opposite side's
|
|
4
|
+
* perspective. `mirrorBoard(b).black` is the rank-mirror of `b.white`; the
|
|
5
|
+
* start position maps to itself and `mirrorBoard(mirrorBoard(b))` equals `b`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const mirrorBoard: (b: Board) => Board;
|
|
8
|
+
/** 180° rotation (rank + file mirror), colors unchanged. */
|
|
9
|
+
export declare const rotateBoard: (b: Board) => Board;
|
|
10
|
+
/** Color swap in place: white<->black piece sets swap, squares unchanged. */
|
|
11
|
+
export declare const flipColor: (b: Board) => Board;
|
|
12
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/chessops/transform.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAsDxC;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,KAAK,KAAG,KAA4C,CAAC;AAEpF,4DAA4D;AAC5D,eAAO,MAAM,WAAW,GAAI,GAAG,KAAK,KAAG,KACqB,CAAC;AAE7D,6EAA6E;AAC7E,eAAO,MAAM,SAAS,GAAI,GAAG,KAAK,KAAG,KAA0C,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { boardFromEngine, boardToEngine } from "./convert.js";
|
|
2
|
+
/**
|
|
3
|
+
* Reverses the byte order of a 32-bit word: rank b of the half maps to rank
|
|
4
|
+
* 3-b of the opposite half (square s -> s ^ 56 across the whole 64-bit board).
|
|
5
|
+
*/
|
|
6
|
+
function byteReverse32(x) {
|
|
7
|
+
x = x >>> 0;
|
|
8
|
+
return (((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x >>> 8) & 0xff00) | ((x >>> 24) & 0xff)) >>> 0;
|
|
9
|
+
}
|
|
10
|
+
/** Vertical (rank) mirror via the {lo,hi} cross-byte swap. */
|
|
11
|
+
function rankMirror(set) {
|
|
12
|
+
return { lo: byteReverse32(set.hi >>> 0), hi: byteReverse32(set.lo >>> 0) };
|
|
13
|
+
}
|
|
14
|
+
/** Horizontal (file) mirror: square s -> s ^ 7, bit-reversal within each rank byte. */
|
|
15
|
+
function fileMirror32(x) {
|
|
16
|
+
x = x >>> 0;
|
|
17
|
+
x = ((x & 0x55555555) << 1) | ((x >>> 1) & 0x55555555);
|
|
18
|
+
x = ((x & 0x33333333) << 2) | ((x >>> 2) & 0x33333333);
|
|
19
|
+
x = ((x & 0x0f0f0f0f) << 4) | ((x >>> 4) & 0x0f0f0f0f);
|
|
20
|
+
return x >>> 0;
|
|
21
|
+
}
|
|
22
|
+
function fileMirror(set) {
|
|
23
|
+
return { lo: fileMirror32(set.lo >>> 0), hi: fileMirror32(set.hi >>> 0) };
|
|
24
|
+
}
|
|
25
|
+
const IDENTITY = (s) => ({ lo: s.lo >>> 0, hi: s.hi >>> 0 });
|
|
26
|
+
function transformBoard(b, f, swapColors) {
|
|
27
|
+
const src = boardToEngine(b);
|
|
28
|
+
const white = f(src.white);
|
|
29
|
+
const black = f(src.black);
|
|
30
|
+
const out = {
|
|
31
|
+
white: swapColors ? black : white,
|
|
32
|
+
black: swapColors ? white : black,
|
|
33
|
+
pawn: f(src.pawn),
|
|
34
|
+
knight: f(src.knight),
|
|
35
|
+
bishop: f(src.bishop),
|
|
36
|
+
rook: f(src.rook),
|
|
37
|
+
queen: f(src.queen),
|
|
38
|
+
king: f(src.king),
|
|
39
|
+
occupied: f(src.occupied),
|
|
40
|
+
promoted: f(src.promoted),
|
|
41
|
+
};
|
|
42
|
+
return boardFromEngine(out);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Vertical mirror + color swap: the position seen from the opposite side's
|
|
46
|
+
* perspective. `mirrorBoard(b).black` is the rank-mirror of `b.white`; the
|
|
47
|
+
* start position maps to itself and `mirrorBoard(mirrorBoard(b))` equals `b`.
|
|
48
|
+
*/
|
|
49
|
+
export const mirrorBoard = (b) => transformBoard(b, rankMirror, true);
|
|
50
|
+
/** 180° rotation (rank + file mirror), colors unchanged. */
|
|
51
|
+
export const rotateBoard = (b) => transformBoard(b, (s) => fileMirror(rankMirror(s)), false);
|
|
52
|
+
/** Color swap in place: white<->black piece sets swap, squares unchanged. */
|
|
53
|
+
export const flipColor = (b) => transformBoard(b, IDENTITY, true);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const FILE_NAMES: readonly ["a", "b", "c", "d", "e", "f", "g", "h"];
|
|
2
|
+
export type FileName = (typeof FILE_NAMES)[number];
|
|
3
|
+
export declare const RANK_NAMES: readonly ["1", "2", "3", "4", "5", "6", "7", "8"];
|
|
4
|
+
export type RankName = (typeof RANK_NAMES)[number];
|
|
5
|
+
export type Square = number;
|
|
6
|
+
export type SquareName = `${FileName}${RankName}`;
|
|
7
|
+
export declare const ROLE_CHARS: readonly ["q", "n", "r", "b", "p", "k"];
|
|
8
|
+
export type RoleChar = (typeof ROLE_CHARS)[number];
|
|
9
|
+
export type BySquare<T> = T[];
|
|
10
|
+
export declare const COLORS: readonly ["white", "black"];
|
|
11
|
+
export type Color = (typeof COLORS)[number];
|
|
12
|
+
export type ByColor<T> = {
|
|
13
|
+
[color in Color]: T;
|
|
14
|
+
};
|
|
15
|
+
export declare const ROLES: readonly ["pawn", "knight", "bishop", "rook", "queen", "king"];
|
|
16
|
+
export type Role = (typeof ROLES)[number];
|
|
17
|
+
export type ByRole<T> = {
|
|
18
|
+
[role in Role]: T;
|
|
19
|
+
};
|
|
20
|
+
export declare const CASTLING_SIDES: readonly ["a", "h"];
|
|
21
|
+
export type CastlingSide = (typeof CASTLING_SIDES)[number];
|
|
22
|
+
export type ByCastlingSide<T> = {
|
|
23
|
+
[side in CastlingSide]: T;
|
|
24
|
+
};
|
|
25
|
+
export interface Piece {
|
|
26
|
+
role: Role;
|
|
27
|
+
color: Color;
|
|
28
|
+
promoted?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface NormalMove {
|
|
31
|
+
from: Square;
|
|
32
|
+
to: Square;
|
|
33
|
+
promotion?: Role;
|
|
34
|
+
}
|
|
35
|
+
export interface DropMove {
|
|
36
|
+
role: Role;
|
|
37
|
+
to: Square;
|
|
38
|
+
}
|
|
39
|
+
export type Move = NormalMove | DropMove;
|
|
40
|
+
export declare const isDrop: (v: Move) => v is DropMove;
|
|
41
|
+
export declare const isNormal: (v: Move) => v is NormalMove;
|
|
42
|
+
export declare const RULES: readonly ["chess"];
|
|
43
|
+
export type Rules = (typeof RULES)[number];
|
|
44
|
+
export interface Outcome {
|
|
45
|
+
winner: Color | undefined;
|
|
46
|
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,CAAC,CAAC,IAAI;KAAG,IAAI,IAAI,YAAY,GAAG,CAAC;CAAE,CAAC;AAC9D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AACD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AACD,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,QAAQ,CAAC;AACzC,eAAO,MAAM,MAAM,GAAI,GAAG,IAAI,KAAG,CAAC,IAAI,QAAuB,CAAC;AAC9D,eAAO,MAAM,QAAQ,GAAI,GAAG,IAAI,KAAG,CAAC,IAAI,UAAyB,CAAC;AAClE,eAAO,MAAM,KAAK,oBAAqB,CAAC;AACxC,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC;CAC3B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/baseline/types.ts — baseline-exact public types (string enums, constants)
|
|
2
|
+
// Part of the baseline-compatible public API (ADR-014). Backed by the
|
|
3
|
+
// immutable turbochess engine; callers' inputs are never mutated.
|
|
4
|
+
export const FILE_NAMES = ["a", "b", "c", "d", "e", "f", "g", "h"];
|
|
5
|
+
export const RANK_NAMES = ["1", "2", "3", "4", "5", "6", "7", "8"];
|
|
6
|
+
export const ROLE_CHARS = ["q", "n", "r", "b", "p", "k"];
|
|
7
|
+
export const COLORS = ["white", "black"];
|
|
8
|
+
export const ROLES = ["pawn", "knight", "bishop", "rook", "queen", "king"];
|
|
9
|
+
export const CASTLING_SIDES = ["a", "h"];
|
|
10
|
+
export const isDrop = (v) => "role" in v;
|
|
11
|
+
export const isNormal = (v) => "from" in v;
|
|
12
|
+
export const RULES = ["chess"];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CastlingSide, Color, Move, Role, RoleChar, Square, SquareName } from "./types.js";
|
|
2
|
+
export declare const defined: <A>(v: A | undefined) => v is A;
|
|
3
|
+
export declare const opposite: (color: Color) => Color;
|
|
4
|
+
export declare const squareRank: (square: Square) => number;
|
|
5
|
+
export declare const squareFile: (square: Square) => number;
|
|
6
|
+
export declare const squareFromCoords: (file: number, rank: number) => Square | undefined;
|
|
7
|
+
export declare const roleToChar: (role: Role) => RoleChar;
|
|
8
|
+
export declare function charToRole(ch: RoleChar | Uppercase<RoleChar>): Role;
|
|
9
|
+
export declare function charToRole(ch: string): Role | undefined;
|
|
10
|
+
export declare function parseSquare(str: SquareName): Square;
|
|
11
|
+
export declare function parseSquare(str: string): Square | undefined;
|
|
12
|
+
export declare const makeSquare: (square: Square) => SquareName;
|
|
13
|
+
export declare const parseUci: (str: string) => Move | undefined;
|
|
14
|
+
export declare const moveEquals: (left: Move, right: Move) => boolean;
|
|
15
|
+
/** Converts a move to UCI notation, like `g1f3` or `a7a8q`. */
|
|
16
|
+
export declare const makeUci: (move: Move) => string;
|
|
17
|
+
export declare const kingCastlesTo: (color: Color, side: CastlingSide) => Square;
|
|
18
|
+
export declare const rookCastlesTo: (color: Color, side: CastlingSide) => Square;
|
|
19
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/chessops/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEhG,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,GA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(color) => (color === "white" ? "black" : "white");
|
|
3
|
+
export const squareRank = (square) => square >> 3;
|
|
4
|
+
export const squareFile = (square) => square & 7;
|
|
5
|
+
export const squareFromCoords = (file, rank) => file >= 0 && file < 8 && rank >= 0 && rank < 8 ? rank * 8 + file : undefined;
|
|
6
|
+
export const roleToChar = (role) => ({ pawn: "p", knight: "n", bishop: "b", rook: "r", queen: "q", king: "k" })[role];
|
|
7
|
+
export function charToRole(ch) {
|
|
8
|
+
const c = ch.toLowerCase();
|
|
9
|
+
return c === "p" || c === "n" || c === "b" || c === "r" || c === "q" || c === "k"
|
|
10
|
+
? { p: "pawn", n: "knight", b: "bishop", r: "rook", q: "queen", k: "king" }[c]
|
|
11
|
+
: undefined;
|
|
12
|
+
}
|
|
13
|
+
export function parseSquare(str) {
|
|
14
|
+
if (str.length !== 2)
|
|
15
|
+
return undefined;
|
|
16
|
+
const file = str.charCodeAt(0) - 97;
|
|
17
|
+
const rank = str.charCodeAt(1) - 49;
|
|
18
|
+
if (file < 0 || file > 7 || rank < 0 || rank > 7)
|
|
19
|
+
return undefined;
|
|
20
|
+
return rank * 8 + file;
|
|
21
|
+
}
|
|
22
|
+
export const makeSquare = (square) => `${String.fromCharCode(97 + (square & 7))}${String.fromCharCode(49 + (square >> 3))}`;
|
|
23
|
+
export const parseUci = (str) => {
|
|
24
|
+
if (str.length === 4 || str.length === 5) {
|
|
25
|
+
const from = parseSquare(str.slice(0, 2));
|
|
26
|
+
const to = parseSquare(str.slice(2, 4));
|
|
27
|
+
if (from !== undefined && to !== undefined) {
|
|
28
|
+
if (str.length === 4)
|
|
29
|
+
return { from, to };
|
|
30
|
+
const promotion = charToRole(str[4]);
|
|
31
|
+
if (promotion && promotion !== "pawn" && promotion !== "king")
|
|
32
|
+
return { from, to, promotion };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
};
|
|
37
|
+
export const moveEquals = (left, right) => {
|
|
38
|
+
if ("role" in left && "role" in right)
|
|
39
|
+
return left.role === right.role && left.to === right.to;
|
|
40
|
+
if ("from" in left && "from" in right) {
|
|
41
|
+
return left.from === right.from && left.to === right.to && left.promotion === right.promotion;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
};
|
|
45
|
+
/** Converts a move to UCI notation, like `g1f3` or `a7a8q`. */
|
|
46
|
+
export const makeUci = (move) => {
|
|
47
|
+
if ("role" in move)
|
|
48
|
+
return `${roleToChar(move.role).toUpperCase()}@${makeSquare(move.to)}`;
|
|
49
|
+
return makeSquare(move.from) + makeSquare(move.to) + (move.promotion ? roleToChar(move.promotion) : "");
|
|
50
|
+
};
|
|
51
|
+
export const kingCastlesTo = (color, side) => color === "white" ? (side === "a" ? 2 : 6) : side === "a" ? 58 : 62;
|
|
52
|
+
export const rookCastlesTo = (color, side) => color === "white" ? (side === "a" ? 3 : 5) : side === "a" ? 59 : 61;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
export type Path = string;
|
|
2
|
+
export interface Comment {
|
|
3
|
+
id: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Glyph {
|
|
7
|
+
symbol: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Clock {
|
|
11
|
+
white: number;
|
|
12
|
+
black: number;
|
|
13
|
+
}
|
|
14
|
+
export interface Shape {
|
|
15
|
+
orig: string;
|
|
16
|
+
dest?: string;
|
|
17
|
+
brush: string;
|
|
18
|
+
piece?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Eval {
|
|
21
|
+
cp: number;
|
|
22
|
+
best: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TreeNode {
|
|
25
|
+
id: string;
|
|
26
|
+
ply: number;
|
|
27
|
+
san?: string;
|
|
28
|
+
fen: string;
|
|
29
|
+
uci: string;
|
|
30
|
+
children: TreeNode[];
|
|
31
|
+
eval?: Eval;
|
|
32
|
+
check?: string;
|
|
33
|
+
dests?: string;
|
|
34
|
+
drops?: string;
|
|
35
|
+
comments?: Comment[];
|
|
36
|
+
startingComments?: Comment[];
|
|
37
|
+
glyphs?: Glyph[];
|
|
38
|
+
clock?: Clock;
|
|
39
|
+
shapes?: Shape[];
|
|
40
|
+
forceVariation?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface Game {
|
|
43
|
+
fen: string;
|
|
44
|
+
id: string;
|
|
45
|
+
opening: unknown;
|
|
46
|
+
player: unknown;
|
|
47
|
+
status: {
|
|
48
|
+
id: number;
|
|
49
|
+
name: string;
|
|
50
|
+
};
|
|
51
|
+
turns: number;
|
|
52
|
+
variant: {
|
|
53
|
+
key: string;
|
|
54
|
+
name: string;
|
|
55
|
+
short: string;
|
|
56
|
+
};
|
|
57
|
+
result?: string;
|
|
58
|
+
white?: {
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
61
|
+
black?: {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
event?: string;
|
|
65
|
+
site?: string;
|
|
66
|
+
date?: string;
|
|
67
|
+
round?: string;
|
|
68
|
+
whiteElo?: string;
|
|
69
|
+
blackElo?: string;
|
|
70
|
+
timeControl?: string;
|
|
71
|
+
termination?: string;
|
|
72
|
+
tags: Record<string, string>;
|
|
73
|
+
}
|
|
74
|
+
export interface Player {
|
|
75
|
+
color: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface AnalyseData {
|
|
79
|
+
game: Game;
|
|
80
|
+
player: Player;
|
|
81
|
+
opponent: Player;
|
|
82
|
+
treeParts: TreeNode[];
|
|
83
|
+
sidelines: TreeNode[][];
|
|
84
|
+
userAnalysis: boolean;
|
|
85
|
+
}
|
|
86
|
+
export declare function pgnImport(pgn: string): AnalyseData;
|
|
87
|
+
export interface TreeWrapper {
|
|
88
|
+
root: TreeNode;
|
|
89
|
+
lastPly(): number;
|
|
90
|
+
nodeAtPath(path: Path): TreeNode | undefined;
|
|
91
|
+
getNodeList(path: Path): TreeNode[];
|
|
92
|
+
nodesOnPath(path: Path): TreeNode[];
|
|
93
|
+
longestValidPath(path: Path): Path;
|
|
94
|
+
addNode(node: TreeNode, path: Path): Path | undefined;
|
|
95
|
+
addNodes(nodes: TreeNode[], path: Path): Path | undefined;
|
|
96
|
+
setCommentAt(comment: Comment, path: Path): TreeNode | undefined;
|
|
97
|
+
deleteCommentAt(id: string, path: Path): TreeNode | undefined;
|
|
98
|
+
setGlyphsAt(glyphs: Glyph[], path: Path): TreeNode | undefined;
|
|
99
|
+
setClockAt(clock: Clock | undefined, path: Path): TreeNode | undefined;
|
|
100
|
+
pathIsMainline(path: Path): boolean;
|
|
101
|
+
pathExists(path: Path): boolean;
|
|
102
|
+
parentNode(path: Path): TreeNode | undefined;
|
|
103
|
+
export(): string;
|
|
104
|
+
pgn(): string;
|
|
105
|
+
}
|
|
106
|
+
export declare class TreeWrapperImpl implements TreeWrapper {
|
|
107
|
+
root: TreeNode;
|
|
108
|
+
constructor(root: TreeNode);
|
|
109
|
+
lastPly(): number;
|
|
110
|
+
nodeAtPath(path: Path): TreeNode | undefined;
|
|
111
|
+
getNodeList(path: Path): TreeNode[];
|
|
112
|
+
nodesOnPath(path: Path): TreeNode[];
|
|
113
|
+
longestValidPath(path: Path): Path;
|
|
114
|
+
addNode(node: TreeNode, path: Path): Path | undefined;
|
|
115
|
+
addNodes(nodes: TreeNode[], path: Path): Path | undefined;
|
|
116
|
+
setCommentAt(comment: Comment, path: Path): TreeNode | undefined;
|
|
117
|
+
deleteCommentAt(id: string, path: Path): TreeNode | undefined;
|
|
118
|
+
setGlyphsAt(glyphs: Glyph[], path: Path): TreeNode | undefined;
|
|
119
|
+
setClockAt(clock: Clock | undefined, path: Path): TreeNode | undefined;
|
|
120
|
+
pathIsMainline(path: Path): boolean;
|
|
121
|
+
pathExists(path: Path): boolean;
|
|
122
|
+
parentNode(path: Path): TreeNode | undefined;
|
|
123
|
+
export(): string;
|
|
124
|
+
pgn(): string;
|
|
125
|
+
}
|
|
126
|
+
export declare function build(root: TreeNode): TreeWrapper;
|
|
127
|
+
export interface AnalyseCtrl {
|
|
128
|
+
data: {
|
|
129
|
+
game: Game;
|
|
130
|
+
};
|
|
131
|
+
tree: TreeWrapper;
|
|
132
|
+
}
|
|
133
|
+
export declare const pgnExport: {
|
|
134
|
+
/** Full PGN (tags + movetext) — byte-compatible with the reference baseline's
|
|
135
|
+
* output for the surfaces consumers use (STRO headers, FEN/SetUp, comments,
|
|
136
|
+
* variations, result). */
|
|
137
|
+
renderFullTxt(ctrl: AnalyseCtrl): string;
|
|
138
|
+
/** Renders a node list as a one-line PGN mainline (no result token). */
|
|
139
|
+
renderVariationPgn(game: Game, nodeList: TreeNode[]): string;
|
|
140
|
+
};
|
|
141
|
+
/** chesstree-compatible alias — `import { buildTree } from "turbochess/chesstree"`. */
|
|
142
|
+
export declare const buildTree: typeof build;
|
|
143
|
+
//# sourceMappingURL=chesstree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chesstree.d.ts","sourceRoot":"","sources":["../src/chesstree.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,Q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