gigachess 0.4.3 → 0.6.0
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/README.md +94 -39
- package/dist/attacks.d.ts +12 -4
- package/dist/attacks.d.ts.map +1 -1
- package/dist/attacks.js +161 -74
- package/dist/bishopSplit32Blob.d.ts +2 -0
- package/dist/bishopSplit32Blob.d.ts.map +1 -0
- package/dist/bishopSplit32Blob.js +2 -0
- package/dist/board.d.ts +27 -1
- package/dist/board.d.ts.map +1 -1
- package/dist/board.js +351 -36
- package/dist/castling.d.ts +2 -0
- package/dist/castling.d.ts.map +1 -1
- package/dist/castling.js +27 -12
- package/dist/chess.d.ts +11 -4
- package/dist/chess.d.ts.map +1 -1
- package/dist/chess.js +521 -137
- package/dist/chesstree.d.ts +9 -0
- package/dist/chesstree.d.ts.map +1 -1
- package/dist/chesstree.js +85 -7
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +1 -1
- package/dist/fast/bishopSplit32Blob-NOHWZEWR.js +1 -0
- package/dist/fast/index.js +1 -0
- package/dist/fast/rookSplit32Blob-C3ANUNTJ.js +1 -0
- package/dist/fast/zobristBlob-HIMMLZLJ.js +1 -0
- package/dist/fast.d.ts +12 -0
- package/dist/fast.d.ts.map +1 -0
- package/dist/fast.js +11 -0
- package/dist/fen.d.ts.map +1 -1
- package/dist/fen.js +139 -124
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/perftCompact.d.ts +3 -0
- package/dist/perftCompact.d.ts.map +1 -0
- package/dist/perftCompact.js +358 -0
- package/dist/pgn.d.ts +4 -0
- package/dist/pgn.d.ts.map +1 -1
- package/dist/pgn.js +7 -2
- package/dist/rookSplit32Blob.d.ts +2 -0
- package/dist/rookSplit32Blob.d.ts.map +1 -0
- package/dist/rookSplit32Blob.js +2 -0
- package/dist/san.d.ts.map +1 -1
- package/dist/san.js +14 -40
- package/dist/squareSet.d.ts +2 -0
- package/dist/squareSet.d.ts.map +1 -1
- package/dist/squareSet.js +6 -1
- package/dist/standardMovegen.d.ts +3 -0
- package/dist/standardMovegen.d.ts.map +1 -0
- package/dist/standardMovegen.js +253 -0
- package/dist/zobrist.d.ts.map +1 -1
- package/dist/zobrist.js +17 -15
- package/package.json +15 -6
- package/dist/bishopMagicBlob.d.ts +0 -2
- package/dist/bishopMagicBlob.d.ts.map +0 -1
- package/dist/bishopMagicBlob.js +0 -11
- package/dist/rookMagicBlob.d.ts +0 -2
- package/dist/rookMagicBlob.d.ts.map +0 -1
- package/dist/rookMagicBlob.js +0 -11
package/dist/fen.js
CHANGED
|
@@ -139,59 +139,105 @@ export function parseFen(fen, opts) {
|
|
|
139
139
|
// per-piece `setPiece`. The scanner walks the raw string with charCodeAt:
|
|
140
140
|
// '/' drops a rank, '1'..'8' skips empty squares, anything else must be a
|
|
141
141
|
// piece letter (color = uppercase ⇒ white).
|
|
142
|
-
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
142
|
+
// Build locally owned words, then materialize the public board once.
|
|
143
|
+
let scratch;
|
|
144
|
+
{
|
|
145
|
+
let wl = 0, wh = 0, bl = 0, bh = 0, pl = 0, ph = 0, nl = 0, nh = 0, il = 0, ih = 0, rl = 0, rh = 0, ql = 0, qh = 0, kl = 0, kh = 0;
|
|
146
|
+
let wk = -1, bk = -1, r = 7, file = 0;
|
|
147
|
+
for (let k = fs[0]; k < fe[0]; k++) {
|
|
148
|
+
const c = fen.charCodeAt(k);
|
|
149
|
+
if (c === 47) {
|
|
150
|
+
if (file !== 8 || r === 0)
|
|
151
|
+
return Err({ code: "fen/invalidPiecePlacement" });
|
|
152
|
+
r--;
|
|
153
|
+
file = 0;
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (c >= 49 && c <= 56) {
|
|
157
|
+
file += c - 48;
|
|
158
|
+
if (file > 8)
|
|
159
|
+
return Err({ code: "fen/invalidPiecePlacement" });
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (file >= 8)
|
|
159
163
|
return Err({ code: "fen/invalidPiecePlacement" });
|
|
160
|
-
|
|
164
|
+
const index = r * 8 + file, bit = 1 << (index & 31), high = index >= 32, white = c < 97;
|
|
165
|
+
if (high) {
|
|
166
|
+
switch (c | 32) {
|
|
167
|
+
case 112:
|
|
168
|
+
ph |= bit;
|
|
169
|
+
break;
|
|
170
|
+
case 110:
|
|
171
|
+
nh |= bit;
|
|
172
|
+
break;
|
|
173
|
+
case 98:
|
|
174
|
+
ih |= bit;
|
|
175
|
+
break;
|
|
176
|
+
case 114:
|
|
177
|
+
rh |= bit;
|
|
178
|
+
break;
|
|
179
|
+
case 113:
|
|
180
|
+
qh |= bit;
|
|
181
|
+
break;
|
|
182
|
+
case 107:
|
|
183
|
+
kh |= bit;
|
|
184
|
+
if (white)
|
|
185
|
+
wk = index;
|
|
186
|
+
else
|
|
187
|
+
bk = index;
|
|
188
|
+
break;
|
|
189
|
+
default: return Err({ code: "fen/invalidPiecePlacement" });
|
|
190
|
+
}
|
|
191
|
+
if (white)
|
|
192
|
+
wh |= bit;
|
|
193
|
+
else
|
|
194
|
+
bh |= bit;
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
switch (c | 32) {
|
|
198
|
+
case 112:
|
|
199
|
+
pl |= bit;
|
|
200
|
+
break;
|
|
201
|
+
case 110:
|
|
202
|
+
nl |= bit;
|
|
203
|
+
break;
|
|
204
|
+
case 98:
|
|
205
|
+
il |= bit;
|
|
206
|
+
break;
|
|
207
|
+
case 114:
|
|
208
|
+
rl |= bit;
|
|
209
|
+
break;
|
|
210
|
+
case 113:
|
|
211
|
+
ql |= bit;
|
|
212
|
+
break;
|
|
213
|
+
case 107:
|
|
214
|
+
kl |= bit;
|
|
215
|
+
if (white)
|
|
216
|
+
wk = index;
|
|
217
|
+
else
|
|
218
|
+
bk = index;
|
|
219
|
+
break;
|
|
220
|
+
default: return Err({ code: "fen/invalidPiecePlacement" });
|
|
221
|
+
}
|
|
222
|
+
if (white)
|
|
223
|
+
wl |= bit;
|
|
224
|
+
else
|
|
225
|
+
bl |= bit;
|
|
226
|
+
}
|
|
227
|
+
file++;
|
|
161
228
|
}
|
|
162
|
-
if (file
|
|
229
|
+
if (file !== 8 || r !== 0)
|
|
163
230
|
return Err({ code: "fen/invalidPiecePlacement" });
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
break; // n
|
|
173
|
-
case 98:
|
|
174
|
-
role = Role.Bishop;
|
|
175
|
-
break; // b
|
|
176
|
-
case 114:
|
|
177
|
-
role = Role.Rook;
|
|
178
|
-
break; // r
|
|
179
|
-
case 113:
|
|
180
|
-
role = Role.Queen;
|
|
181
|
-
break; // q
|
|
182
|
-
case 107:
|
|
183
|
-
role = Role.King;
|
|
184
|
-
break; // k
|
|
185
|
-
default: return Err({ code: "fen/invalidPiecePlacement" });
|
|
186
|
-
}
|
|
187
|
-
const color = c >= 97 ? Color.Black : Color.White; // lowercase ⇒ black
|
|
188
|
-
const sqIdx = r * 8 + file;
|
|
189
|
-
board.putPieceInPlace(scratch, sqIdx, { color, role });
|
|
190
|
-
file++;
|
|
231
|
+
scratch = {
|
|
232
|
+
white: { lo: wl >>> 0, hi: wh >>> 0 }, black: { lo: bl >>> 0, hi: bh >>> 0 },
|
|
233
|
+
pawn: { lo: pl >>> 0, hi: ph >>> 0 }, knight: { lo: nl >>> 0, hi: nh >>> 0 },
|
|
234
|
+
bishop: { lo: il >>> 0, hi: ih >>> 0 }, rook: { lo: rl >>> 0, hi: rh >>> 0 },
|
|
235
|
+
queen: { lo: ql >>> 0, hi: qh >>> 0 }, king: { lo: kl >>> 0, hi: kh >>> 0 },
|
|
236
|
+
occupied: { lo: (wl | bl) >>> 0, hi: (wh | bh) >>> 0 }, promoted: { lo: 0, hi: 0 },
|
|
237
|
+
kingSq: [wk, bk]
|
|
238
|
+
};
|
|
191
239
|
}
|
|
192
|
-
|
|
193
|
-
return Err({ code: "fen/invalidPiecePlacement" });
|
|
194
|
-
const curBoard = board.cloneBoard(scratch);
|
|
240
|
+
const curBoard = scratch;
|
|
195
241
|
// ----- active color -----
|
|
196
242
|
let turn;
|
|
197
243
|
if (fieldCount < 2) {
|
|
@@ -210,8 +256,9 @@ export function parseFen(fen, opts) {
|
|
|
210
256
|
return Err({ code: "fen/invalidActiveColor" });
|
|
211
257
|
}
|
|
212
258
|
// ----- castling -----
|
|
213
|
-
let
|
|
214
|
-
|
|
259
|
+
let standardMask = 0;
|
|
260
|
+
const whiteSet = opts?.chess960 ? new Set() : undefined;
|
|
261
|
+
const blackSet = opts?.chess960 ? new Set() : undefined;
|
|
215
262
|
const castlingStart = fieldCount > 2 ? fs[2] : -1;
|
|
216
263
|
const castlingIsDash = castlingStart === -1 || (fe[2] - fs[2] === 1 && fen.charCodeAt(fs[2]) === 45);
|
|
217
264
|
if (!castlingIsDash) {
|
|
@@ -231,13 +278,13 @@ export function parseFen(fen, opts) {
|
|
|
231
278
|
return Err({ code: "fen/invalidCastling" });
|
|
232
279
|
}
|
|
233
280
|
if (ch === "K")
|
|
234
|
-
|
|
281
|
+
standardMask |= CASTLE_WK;
|
|
235
282
|
else if (ch === "Q")
|
|
236
|
-
|
|
283
|
+
standardMask |= CASTLE_WQ;
|
|
237
284
|
else if (ch === "k")
|
|
238
|
-
|
|
285
|
+
standardMask |= CASTLE_BK;
|
|
239
286
|
else if (ch === "q")
|
|
240
|
-
|
|
287
|
+
standardMask |= CASTLE_BQ;
|
|
241
288
|
}
|
|
242
289
|
else {
|
|
243
290
|
// chess960 tolerant
|
|
@@ -334,7 +381,7 @@ export function parseFen(fen, opts) {
|
|
|
334
381
|
// duplicate check not needed; Set handles
|
|
335
382
|
// For non-960, ensure no duplicate file letters etc already handled
|
|
336
383
|
}
|
|
337
|
-
const castling = makeCastling(whiteSet, blackSet);
|
|
384
|
+
const castling = opts?.chess960 ? makeCastling(whiteSet, blackSet) : CASTLING_RIGHTS_TABLE[standardMask];
|
|
338
385
|
// ----- en passant -----
|
|
339
386
|
// Structural validation (square name + rank for the side to move) stays
|
|
340
387
|
// unconditional per purechess-rules. The capturability check moves behind
|
|
@@ -383,7 +430,7 @@ export function parseFen(fen, opts) {
|
|
|
383
430
|
}
|
|
384
431
|
// ----- halfmove -----
|
|
385
432
|
const half = fieldCount > 4 ? parseFenCount(fen, fs[4], fe[4]) : 0;
|
|
386
|
-
if (!Number.
|
|
433
|
+
if (!Number.isSafeInteger(half) || half < 0)
|
|
387
434
|
return Err({ code: "fen/invalidHalfmove" });
|
|
388
435
|
// ----- fullmove -----
|
|
389
436
|
const full = fieldCount > 5 ? parseFenCount(fen, fs[5], fe[5]) : 1;
|
|
@@ -391,48 +438,29 @@ export function parseFen(fen, opts) {
|
|
|
391
438
|
return Err({ code: "fen/invalidFullmove" });
|
|
392
439
|
// ----- validations per purechess-rules -----
|
|
393
440
|
// pawn on back rank
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return Err({ code: "fen/pawnOnBackRank" });
|
|
401
|
-
if (p8 && p8.role === Role.Pawn)
|
|
402
|
-
return Err({ code: "fen/pawnOnBackRank" });
|
|
403
|
-
}
|
|
404
|
-
// kings count
|
|
405
|
-
const whiteKings = sq.popcnt(sq.and(curBoard.white, curBoard.king));
|
|
406
|
-
const blackKings = sq.popcnt(sq.and(curBoard.black, curBoard.king));
|
|
407
|
-
const totalKings = sq.popcnt(curBoard.king);
|
|
408
|
-
if (totalKings !== 2 || whiteKings !== 1 || blackKings !== 1) {
|
|
441
|
+
if ((curBoard.pawn.lo & 255) || (curBoard.pawn.hi & 0xff000000))
|
|
442
|
+
return Err({ code: "fen/pawnOnBackRank" });
|
|
443
|
+
const wl = curBoard.white.lo & curBoard.king.lo, wh = curBoard.white.hi & curBoard.king.hi;
|
|
444
|
+
const bl = curBoard.black.lo & curBoard.king.lo, bh = curBoard.black.hi & curBoard.king.hi;
|
|
445
|
+
const w = wl | wh, b = bl | bh;
|
|
446
|
+
if (!w || !b || (wl && wh) || (bl && bh) || (w & (w - 1)) || (b & (b - 1)))
|
|
409
447
|
return Err({ code: "fen/kingsCount" });
|
|
410
|
-
}
|
|
411
448
|
// kings adjacent
|
|
412
|
-
const wkSq =
|
|
413
|
-
const bkSq =
|
|
449
|
+
const wkSq = scratch.kingSq[Color.White];
|
|
450
|
+
const bkSq = scratch.kingSq[Color.Black];
|
|
414
451
|
if (wkSq !== undefined && bkSq !== undefined) {
|
|
415
452
|
const wAtt = attacks.kingAttacks(wkSq);
|
|
416
453
|
if (sq.has(wAtt, bkSq))
|
|
417
454
|
return Err({ code: "fen/kingsAdjacent" });
|
|
418
455
|
}
|
|
419
|
-
//
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
// illegal if both in check
|
|
424
|
-
if (whiteAttacked && blackAttacked)
|
|
425
|
-
return Err({ code: "fen/oppositeCheck" });
|
|
426
|
-
// illegal if opponent king is in check (side not to move)
|
|
427
|
-
if (turn === Color.White && blackAttacked)
|
|
428
|
-
return Err({ code: "fen/oppositeCheck" });
|
|
429
|
-
if (turn === Color.Black && whiteAttacked)
|
|
430
|
-
return Err({ code: "fen/oppositeCheck" });
|
|
431
|
-
}
|
|
456
|
+
// Only the non-moving king must not be attacked; double check of
|
|
457
|
+
// both kings necessarily violates that condition as well.
|
|
458
|
+
if (turn === Color.White ? attacks.isAttacked(curBoard, bkSq, Color.White) : attacks.isAttacked(curBoard, wkSq, Color.Black))
|
|
459
|
+
return Err({ code: "fen/oppositeCheck" });
|
|
432
460
|
const is960 = !!opts?.chess960;
|
|
433
461
|
const kingSqPair = [wkSq ?? -1, bkSq ?? -1];
|
|
434
462
|
curBoard.kingSq = kingSqPair;
|
|
435
|
-
const chk = attacks.
|
|
463
|
+
const chk = attacks.attackersTo(curBoard, kingSqPair[turn], turn === Color.White ? Color.Black : Color.White);
|
|
436
464
|
const setup = {
|
|
437
465
|
board: curBoard,
|
|
438
466
|
turn,
|
|
@@ -459,44 +487,31 @@ export function parseFen(fen, opts) {
|
|
|
459
487
|
}
|
|
460
488
|
export function makeFen(setup, opts) {
|
|
461
489
|
const boardVal = setup.board;
|
|
462
|
-
// piece placement
|
|
463
490
|
let placement = "";
|
|
464
491
|
for (let r = 7; r >= 0; r--) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
ch = isWhite ? "N" : "n";
|
|
485
|
-
else if (sq.has(boardVal.bishop, sqIdx))
|
|
486
|
-
ch = isWhite ? "B" : "b";
|
|
487
|
-
else if (sq.has(boardVal.rook, sqIdx))
|
|
488
|
-
ch = isWhite ? "R" : "r";
|
|
489
|
-
else if (sq.has(boardVal.queen, sqIdx))
|
|
490
|
-
ch = isWhite ? "Q" : "q";
|
|
491
|
-
else
|
|
492
|
-
ch = isWhite ? "K" : "k";
|
|
493
|
-
rankStr += ch;
|
|
494
|
-
}
|
|
492
|
+
const high = r >= 4, shift = (r & 3) * 8;
|
|
493
|
+
const occupied = high ? boardVal.occupied.hi : boardVal.occupied.lo;
|
|
494
|
+
const white = high ? boardVal.white.hi : boardVal.white.lo;
|
|
495
|
+
const pawn = high ? boardVal.pawn.hi : boardVal.pawn.lo;
|
|
496
|
+
const knight = high ? boardVal.knight.hi : boardVal.knight.lo;
|
|
497
|
+
const bishop = high ? boardVal.bishop.hi : boardVal.bishop.lo;
|
|
498
|
+
const rook = high ? boardVal.rook.hi : boardVal.rook.lo;
|
|
499
|
+
const queen = high ? boardVal.queen.hi : boardVal.queen.lo;
|
|
500
|
+
let bits = (occupied >>> shift) & 255, prev = 0;
|
|
501
|
+
while (bits) {
|
|
502
|
+
const bit = bits & -bits, f = 31 - Math.clz32(bit), mask = bit << shift;
|
|
503
|
+
if (f > prev)
|
|
504
|
+
placement += String(f - prev);
|
|
505
|
+
const w = (white & mask) !== 0;
|
|
506
|
+
placement += pawn & mask ? (w ? "P" : "p") : knight & mask ? (w ? "N" : "n") :
|
|
507
|
+
bishop & mask ? (w ? "B" : "b") : rook & mask ? (w ? "R" : "r") :
|
|
508
|
+
queen & mask ? (w ? "Q" : "q") : (w ? "K" : "k");
|
|
509
|
+
prev = f + 1;
|
|
510
|
+
bits &= bits - 1;
|
|
495
511
|
}
|
|
496
|
-
if (
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
if (r > 0)
|
|
512
|
+
if (prev < 8)
|
|
513
|
+
placement += String(8 - prev);
|
|
514
|
+
if (r)
|
|
500
515
|
placement += "/";
|
|
501
516
|
}
|
|
502
517
|
const active = setup.turn === Color.White ? "w" : "b";
|
package/dist/index.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export * from "./packedMove.js";
|
|
|
11
11
|
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, lineRay, LINE_RAY_LO, LINE_RAY_HI, isAttacked, } from "./attacks.js";
|
|
12
12
|
export { kingAttackers } from "./attacks.js";
|
|
13
13
|
export { CASTLE_PATH_LO, CASTLE_PATH_HI, CASTLE_CLEAR_STD, } from "./castling.js";
|
|
14
|
-
export { dests, allDests, detectCastling, isCheck, isCheckFresh, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, isLegal, isNullMoveLegal, perft, countLegalMoves, legalMovesInto, forEachLegalMove, MoveCounter, makeMove, makeNullMove, play, INITIAL_FEN, } from "./chess.js";
|
|
14
|
+
export { dests, allDests, detectCastling, isCheck, isCheckFresh, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, repetitionKey, isFivefoldRepetition, isLegal, isNullMoveLegal, perft, countLegalMoves, legalMovesInto, forEachLegalMove, MoveCounter, makeMove, makeNullMove, play, INITIAL_FEN, } from "./chess.js";
|
|
15
15
|
export type { CastlingPlan, NullUndo } from "./chess.js";
|
|
16
|
-
export { pgnImport, buildTree, build, pgnExport, TreeWrapperImpl, } from "./chesstree.js";
|
|
16
|
+
export { pgnImport, buildTree, build, pgnExport, TreeWrapperImpl, NAG_GLYPHS, glyphForNag, } from "./chesstree.js";
|
|
17
17
|
export type { TreeWrapper, TreeNode, Path, Comment, Glyph, Clock, Shape, Eval as TreeEval, Game, Player, AnalyseData, } from "./chesstree.js";
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,EACH,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,EACP,eAAe,EACf,KAAK,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,SAAS,EACT,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,EACH,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,OAAO,EACP,eAAe,EACf,KAAK,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,IAAI,QAAQ,EAChB,IAAI,EACJ,MAAM,EACN,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,6 @@ export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, qu
|
|
|
16
16
|
export { kingAttackers } from "./attacks.js";
|
|
17
17
|
export { CASTLE_PATH_LO, CASTLE_PATH_HI, CASTLE_CLEAR_STD, } from "./castling.js";
|
|
18
18
|
// chess core (avoid duplicate Position and kingAttackers)
|
|
19
|
-
export { dests, allDests, detectCastling, isCheck, isCheckFresh, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, isLegal, isNullMoveLegal, perft, countLegalMoves, legalMovesInto, forEachLegalMove, MoveCounter, makeMove, makeNullMove, play, INITIAL_FEN, } from "./chess.js";
|
|
19
|
+
export { dests, allDests, detectCastling, isCheck, isCheckFresh, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, repetitionKey, isFivefoldRepetition, isLegal, isNullMoveLegal, perft, countLegalMoves, legalMovesInto, forEachLegalMove, MoveCounter, makeMove, makeNullMove, play, INITIAL_FEN, } from "./chess.js";
|
|
20
20
|
// chesstree integration (tree shapes + analysis API, folded into the root)
|
|
21
|
-
export { pgnImport, buildTree, build, pgnExport, TreeWrapperImpl, } from "./chesstree.js";
|
|
21
|
+
export { pgnImport, buildTree, build, pgnExport, TreeWrapperImpl, NAG_GLYPHS, glyphForNag, } from "./chesstree.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perftCompact.d.ts","sourceRoot":"","sources":["../src/perftCompact.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA6S3C,wBAAgB,YAAY,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmE7E"}
|