-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathvariants.ts
1266 lines (1187 loc) · 61.7 KB
/
variants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { h, InsertHook, VNode } from 'snabbdom';
import * as cg from 'chessgroundx/types';
import * as util from 'chessgroundx/util';
import { BoardMarkType, ColorName, CountingType, MaterialPointType, PieceSoundType, PromotionSuffix, PromotionType, TimeControlType, uci2LastMove } from './chess';
import { _ } from './i18n';
import { calculateDiff, Equivalence, MaterialDiff } from './material';
export interface BoardFamily {
readonly dimensions: cg.BoardDimensions;
readonly cg: string;
readonly boardCSS: string[];
}
export interface PieceFamily {
readonly pieceCSS: string[];
}
export const BOARD_FAMILIES: Record<string, BoardFamily> = {
ataxx7x7: { dimensions: { width: 7, height: 7 }, cg: "cg-448", boardCSS: ["ataxx.svg", "ataxx.png"] },
standard8x8: { dimensions: { width: 8, height: 8 }, cg: "cg-512", boardCSS: ["8x8brown.svg", "8x8blue.svg", "8x8green.svg", "8x8maple.jpg", "8x8olive.jpg", "8x8santa.png", "8x8wood2.jpg", "8x8wood4.jpg", "8x8ic.svg", "8x8purple.svg", "8x8dobutsu.svg"] },
standard9x9: { dimensions: { width: 9, height: 9 }, cg: "cg-540", boardCSS: ["9x9mansindam.svg", "9x9brown.svg", "9x9blue.svg", "9x9green.svg", "9x9maple.jpg", "9x9olive.jpg"] },
standard10x8: { dimensions: { width: 10, height: 8 }, cg: "cg-640", boardCSS: ["10x8brown.svg", "10x8blue.svg", "10x8green.svg", "10x8maple.jpg", "10x8olive.jpg"] },
standard10x10: { dimensions: { width: 10, height: 10 }, cg: "cg-640-640", boardCSS: ["10x10brown.svg", "10x10blue.svg", "10x10green.svg", "10x10maple.jpg", "10x10olive.jpg"] },
grand10x10: { dimensions: { width: 10, height: 10}, cg: "cg-640-640", boardCSS: ["Grandboard.svg", "10x10brown.svg", "10x10blue.svg", "10x10green.svg", "10x10maple.jpg", "10x10mapleGrand.png"] },
makruk8x8: { dimensions: { width: 8, height: 8 }, cg: "cg-512", boardCSS: ["makruk2.svg", "makruk.svg", "makrukWhite.svg", "makruk.jpg", "makrukWood.png"] },
sittuyin8x8: { dimensions: { width: 8, height: 8 }, cg: "cg-512", boardCSS: ["sittuyin2.svg", "sittuyin.svg", "sittuyin.jpg", "sittuyingreen.svg", "sittuyinGrainBrown.svg", "sittuyinWood.png"] },
shogi9x9: { dimensions: { width: 9, height: 9 }, cg: "cg-576", boardCSS: ["shogi.svg", "Shogiban1.png", "Shogiban2.png", "shogic.svg", "ShogiMaple.png", 'ShogiGrayTexture.png', "ShogiSpace1.svg", "dobutsu.png", "ShogiOak.png"] },
shogi7x7: { dimensions: { width: 7, height: 7 }, cg: "cg-448-516", boardCSS: ["ToriPlain.svg", "ToriWood.svg", "ToriDaySky.svg", "ToriNightSky.svg"] },
shogi5x5: { dimensions: { width: 5, height: 5 }, cg: "cg-260", boardCSS: ["minishogi.svg", "MiniboardWood1.png", "MiniboardWood2.png", "MinishogiDobutsu.svg", "MinishogiDobutsu2.svg"] },
shogi5x6: { dimensions: { width: 5, height: 6 }, cg: "cg-260-360", boardCSS: ["gorogoro.svg", "gorogoroboard.svg", "gorogoro2.svg", "GorogoroWood.png"] },
shogi3x4: { dimensions: { width: 3, height: 4 }, cg: "cg-156", boardCSS: ["doubutsuboard.svg", "dobutsu3x4.svg"] },
xiangqi9x10: { dimensions: { width: 9, height: 10 }, cg: "cg-576-640", boardCSS: ["xiangqi.svg", "xiangqic.svg", "xiangqiCTexture.png", "xiangqiPaper.png", "xiangqiWood.png", "xiangqiDark.svg", "xiangqiWikimedia.svg", "xiangqiLightWood.png", "xiangqiSand.svg"] },
xiangqi7x7: { dimensions: { width: 7, height: 7 }, cg: "cg-448", boardCSS: ["minixiangqi.svg", "minixiangqiw.png", "minixqlg.svg"] },
janggi9x10: { dimensions: { width: 9, height: 10 }, cg: "cg-janggi", boardCSS: ["JanggiBrown.svg", "JanggiPaper.png", "JanggiWood.png", "JanggiDark.svg", "JanggiWoodDark.svg", "JanggiStone.svg"] },
shogun8x8: { dimensions: { width: 8, height: 8 }, cg: "cg-512", boardCSS: ["ShogunPlain.svg", "ShogunMaple.png", "ShogunMaple2.png", "ShogunBlue.svg", "8x8brown.svg", "8x8maple.jpg"] },
chak9x9:{ dimensions: { width: 9, height: 9 }, cg: "cg-540", boardCSS: ["StandardChakBoard.svg", "ColoredChakBoard.svg", "ChakArt.jpg"] },
chennis7x7:{ dimensions: { width: 7, height: 7 }, cg: "cg-448", boardCSS: ["WimbledonBoard.svg", "FrenchOpenBoard.svg", "USOpenBoard.svg"] },
};
export const PIECE_FAMILIES: Record<string, PieceFamily> = {
ataxx: { pieceCSS: ["disguised", "virus", "zombie", "cat-dog"] },
standard: { pieceCSS: ["standard", "green", "alpha", "chess_kaneo", "santa", "maestro", "dubrovny", "atopdown", "luffy", "disguised"] },
capa: { pieceCSS: ["capa0", "capa1", "capa2", "capa3", "capa4", "capa5", "disguised"] },
dragon: { pieceCSS: ["dragon1", "dragon0", "dragon2", "disguised"] },
seirawan: { pieceCSS: ["seir1", "seir0", "seir2", "seir3", "seir4", "seir5", "disguised"] },
makruk: { pieceCSS: ["makrukwb", "makrukwr", "makruk", "makruks", "makruki", "makrukc", "disguised"] },
sittuyin: { pieceCSS: ["sittuyins", "sittuyinkagr", "sittuyinkabr", "sittuyinm", "sittuyini", "sittuyincb", "disguised"] },
asean: { pieceCSS: ["aseani", "aseanm", "aseanc", "aseans", "aseancb", "disguised"] },
shogi: { pieceCSS: ["shogik", "shogi", "shogiw", "shogip", "shogim", "shogip3d", "shogikw3d", "shogid", "shogiim", "shogibw", "shogibnw", "portk", "porti", "cz", "disguised"] },
kyoto: { pieceCSS: ["kyoto", "kyotok", "kyotoks", "kyotoi", "kyotod", "disguised"] },
dobutsu: { pieceCSS: ["dobutsu", "disguised"] },
tori: { pieceCSS: ["torii", "torik", "torim", "porti", "cz", "disguised"] },
cannonshogi: { pieceCSS: ["ctp3d", "ctim", "bnw", "cz", "czalt", "disguised"] },
xiangqi: { pieceCSS: ["lishu", "xiangqi2di", "xiangqi", "xiangqict3", "xiangqihnz", "xiangqict2", "lishuw", "xiangqict2w", "xiangqiwikim", "xiangqiKa", "xiangqittxqhnz", "xiangqittxqintl", "xiangqi2d", "xiangqihnzw", 'basic', 'guided', "disguised", "euro"] },
janggi: { pieceCSS: ["janggihb", "janggihg", "janggiikak", "janggiikaw", "janggikak", "janggikaw", "janggiib", "janggiig", "disguised"] },
shatranj: { pieceCSS: ["shatranj0", "shatranj1", "disguised"] },
shako: { pieceCSS: ["shako0", "shako1", "shako2", "disguised"] },
shogun: { pieceCSS: ["shogun0", "shogun1", "shogun2", "shogun3", "shogun4", "shogun5", "disguised"] },
orda: { pieceCSS: ["orda0", "orda1", "disguised"] },
khans: { pieceCSS: ["khans0", "khans1", "disguised"] },
synochess: { pieceCSS: ["synochess0", "synochess1", "synochess2", "synochess3", "synochess4", "synochess5", "disguised"] },
hoppel: { pieceCSS: ["hoppel0", "hoppel1", "hoppel2", "disguised"] },
shinobi: { pieceCSS: ["shinobi0", "shinobi1", "disguised"] },
empire: { pieceCSS: ["empire0", "empire1", "disguised"] },
ordamirror: { pieceCSS: ["ordamirror0", "ordamirror1", "disguised"] },
chak: { pieceCSS: ["chak0", "ronin", "chak1", "chak2", "disguised"] },
chennis: { pieceCSS: ["chennis0", "chennis1", "chennis2", "chennis3", "chennis4", "disguised"] },
spartan: { pieceCSS: ["spartan0", "disguised"] },
mansindam: { pieceCSS: ["mansindam2", "mansindam1", "mansindam3", "mansindam4", "disguised"] },
};
export interface Variant {
readonly name: string;
readonly _displayName: string;
readonly _display960: string;
readonly displayName: (chess960?: boolean) => string;
readonly _tooltip: string;
readonly tooltip: string;
readonly chess960: boolean;
readonly twoBoards: boolean;
readonly _icon: string;
readonly _icon960: string;
readonly icon: (chess960?: boolean) => string;
readonly startFen: string;
readonly boardFamily: keyof typeof BOARD_FAMILIES;
readonly board: BoardFamily;
readonly notation: cg.Notation;
readonly pieceFamily: keyof typeof PIECE_FAMILIES;
readonly piece: PieceFamily;
readonly colors: {
readonly first: ColorName;
readonly second: ColorName;
}
readonly pieceRow: Record<cg.Color, cg.Role[]>;
readonly kingRoles: cg.Role[];
readonly pocket?: {
readonly roles: Record<cg.Color, cg.Role[]>;
readonly captureToHand: boolean;
readonly pieceNames?: Partial<Record<cg.Role, string>>;
};
readonly promotion: {
readonly type: PromotionType;
readonly order: PromotionSuffix[];
readonly roles: cg.Role[];
readonly strict?: {
readonly isPromoted: (piece: cg.Piece, pos: cg.Pos) => boolean;
};
readonly autoPromoteable: boolean;
};
readonly rules: {
readonly defaultTimeControl: TimeControlType;
readonly enPassant: boolean;
readonly gate: boolean;
readonly duck: boolean;
readonly pass: boolean;
readonly setup: boolean;
readonly noDrawOffer: boolean;
};
readonly material: {
readonly showDiff: boolean;
readonly initialDiff: MaterialDiff;
readonly equivalences: Equivalence;
};
readonly ui: {
readonly counting?: CountingType;
readonly materialPoint?: MaterialPointType;
readonly showPromoted: boolean;
readonly pieceSound: PieceSoundType;
readonly boardMark: BoardMarkType | '';
readonly showCheckCounters: boolean;
};
readonly alternateStart?: Record<string, string>;
}
const pieceFamiliesWithMaterialDifferenceSupported = ["standard", "makruk", "sittuyin", "asean", "xiangqi", "janggi", "shatranj", "capa", "dragon", "seirawan", "shako", "hoppel", "orda", "khans", "synochess", "shinobi", "empire", "ordamirror", "chak", "spartan"];
function variant(config: VariantConfig): Variant {
return {
name: config.name,
_displayName: config.displayName ?? config.name,
_display960: config.display960 ?? '960',
displayName: function (chess960 = false) { return _(this._displayName).toUpperCase() + (chess960 ? this._display960 : ''); },
_tooltip: config.tooltip,
get tooltip() { return _(this._tooltip) },
chess960: !!config.chess960,
twoBoards: !!config.twoBoards,
_icon: config.icon,
_icon960: config.icon960 ?? config.icon,
icon: function (chess960 = false) { return chess960 ? this._icon960 : this._icon; },
startFen: config.startFen,
boardFamily: config.boardFamily,
board: BOARD_FAMILIES[config.boardFamily],
pieceFamily: config.pieceFamily,
notation: config.notation ?? cg.Notation.ALGEBRAIC,
piece: PIECE_FAMILIES[config.pieceFamily],
colors: config.colors ?? { first: 'White', second: 'Black' },
pieceRow: Array.isArray(config.pieceRow) ? {
white: config.pieceRow.map(util.roleOf),
black: config.pieceRow.map(util.roleOf),
} : {
white: config.pieceRow.white.map(util.roleOf),
black: config.pieceRow.black.map(util.roleOf),
},
kingRoles: (config.kingRoles ?? ['k']).map(util.roleOf),
pocket: config.pocket ? {
roles: Array.isArray(config.pocket.roles) ? {
white: config.pocket.roles.map(util.roleOf),
black: config.pocket.roles.map(util.roleOf),
} : {
white: config.pocket.roles.white.map(util.roleOf),
black: config.pocket.roles.black.map(util.roleOf),
},
pieceNames: config.pocket?.pieceNames,
captureToHand: config.pocket.captureToHand,
} : undefined,
promotion: {
type: config.promotion?.type ?? 'regular',
order: config.promotion?.order ?? (config.promotion?.type === 'shogi' ? ['+', ''] : ['q', 'c', 'e', 'a', 'h', 'n', 'r', 'b', 'p']),
roles: (config.promotion?.roles ?? ['p']).map(util.roleOf),
strict: config.promotion?.strict,
get autoPromoteable() { return this.order.length > 2 },
},
rules: {
defaultTimeControl: config.rules?.defaultTimeControl ?? 'incremental',
enPassant: !!config.rules?.enPassant,
gate: !!config.rules?.gate,
duck: !!config.rules?.duck,
pass: !!config.rules?.pass,
setup: !!config.rules?.setup,
noDrawOffer: !!config.rules?.noDrawOffer,
},
material: {
showDiff: !config.pocket?.captureToHand && !['ataxx', 'fogofwar', 'horde'].includes(config.name) && pieceFamiliesWithMaterialDifferenceSupported.includes(config.pieceFamily),
initialDiff: calculateDiff(config.startFen, BOARD_FAMILIES[config.boardFamily].dimensions, config.material?.equivalences ?? {}, !!config.pocket?.captureToHand),
equivalences: config.material?.equivalences ?? {},
},
ui: {
counting: config.ui?.counting,
materialPoint: config.ui?.materialPoint,
showPromoted: config.ui?.showPromoted ?? false,
pieceSound: config.ui?.pieceSound ?? 'regular',
boardMark: config.ui?.boardMark ?? '',
showCheckCounters: config.ui?.showCheckCounters ?? false,
},
alternateStart: config.alternateStart,
};
}
interface VariantConfig {
// Name as defined in Fairy-Stockfish
name: string;
// Display name for use on the website (default: same as name)
displayName?: string;
// Display name postfix for variants having randomized start positions (default: '960')
display960?: string;
// Tooltip displayed when variant name is hovered
tooltip: string;
// Start FEN for use in some client-side calculations
startFen: string;
// Whether it is possible to play a randomized starting position (default: false)
chess960?: boolean;
// Pocket pieces are added from an external source, usually from a second board (e.g., bughouse)
twoBoards?: boolean;
// Icon letter in the site's font
icon: string;
// Icon of the 960 version (default: same as icon)
icon960?: string;
// Board appearance
boardFamily: keyof typeof BOARD_FAMILIES;
// Chessground coord/move notation (default: cg.Notation.ALGEBRAIC)
notation?: cg.Notation;
// Piece appearance
pieceFamily: keyof typeof PIECE_FAMILIES;
// Color names of each side for accurate color representation
colors?: {
// (default: White)
first: ColorName;
// (default: Black)
second: ColorName;
}
// Pieces on the editor's piece row
// Use the record version if the pieces of each side are different
pieceRow: cg.Letter[] | Record<cg.Color, cg.Letter[]>;
// Pieces considered king for check marking (default: ['k'])
kingRoles?: cg.Letter[];
pocket?: {
// Pieces in the pocket
// Use the record version if the pieces of each side are different
roles: cg.Letter[] | Record<cg.Color, cg.Letter[]>;
// Translatable names of the pieces in the pocket (used for bug chat tooltip)
pieceNames?: Partial<Record<cg.Role, string>>;
// Whether captured pieces go to the pocket (Fairy's terminology)
captureToHand: boolean;
};
promotion?: {
// Promotion style
// regular: (default) Pawns promote to one or more pieces (like chess)
// shogi: Multiple pieces promote to another piece corresponding to it (like shogi)
type: PromotionType;
// Order of promotion choices to display, top choice will be chosen for auto-promote
// (default: ["q", "c", "e", "a", "h", "n", "r", "b", "p"] for regular)
// (default: ["+", ""] for shogi)
order?: PromotionSuffix[];
// Pieces that can promote (default: ['p'])
roles?: cg.Letter[];
// Whether a piece's promotion state strictly depends on its square (default: undefined)
strict?: {
// Returns true if and only if the given piece would be promoted on the given square
isPromoted: (piece: cg.Piece, pos: cg.Pos) => boolean;
};
};
// Miscellaneous rules useful for client-side processing
// (default: false)
rules?: {
// Default time control (default: incremental)
defaultTimeControl?: TimeControlType;
// Chess's en passant
enPassant?: boolean;
// S-Chess gating
gate?: boolean;
// Duck Chess moving
duck?: boolean;
// Passing without moving a piece on board
pass?: boolean;
// Setup phase
setup?: boolean;
// Draw offer not allowed
noDrawOffer?: boolean;
};
// Material equivalences for material diff calculation
// ex. { 'pl-piece': 'r-piece' } means the "+L" piece is treated as the "R" piece for material diff
material?: {
equivalences?: Equivalence;
},
// UI display info
ui?: {
// SEA variants' counting (default: undefined)
counting?: CountingType;
// Material point (default: undefined)
materialPoint?: MaterialPointType;
// Promoted pieces need to be represented in the FEN even if it's not a drop variant (default: false)
showPromoted?: boolean;
// Sound of the piece moving (default: regular)
pieceSound?: PieceSoundType;
// Board marking for special squares (default: '')
boardMark?: BoardMarkType;
// Render the remaining check numbers on King pieces
showCheckCounters?: boolean;
};
// Alternate starting positions, including handicaps
alternateStart?: Record<string, string>;
}
export const VARIANTS: Record<string, Variant> = {
ataxx: variant({
name: "ataxx", tooltip: "Infection game.",
startFen: "P5p/7/7/7/7/7/p5P w 0 1",
icon: "☣",
boardFamily: "ataxx7x7", pieceFamily: "ataxx",
colors: { first: "Red", second: "Blue" },
pieceRow: ["p", "*"],
rules: { pass: true },
ui: { materialPoint: "ataxx" },
// Ataxx All 19 boards won https://www.youtube.com/watch?v=3VcAW6EKuvU
alternateStart: {
'': "",
'Board 0': "P5p/7/7/7/7/7/p5P w 0 1",
'Board 1': "P5p/7/3*3/2*1*2/3*3/7/p5P w 0 1",
'Board 2': "P5p/7/3*3/2***2/3*3/7/p5P w 0 1",
'Board 3': "P5p/7/2*1*2/7/2*1*2/7/p5P w 0 1",
'Board 4': "P5p/1*3*1/2*1*2/7/2*1*2/1*3*1/p5P w 0 1",
'Board 5': "P5p/7/2*1*2/3*3/2*1*2/7/p5P w 0 1",
'Board 6': "P2*2p/7/7/*5*/7/7/p2*2P w 0 1",
'Board 7': "P2*2p/3*3/7/**3**/7/3*3/p2*2P w 0 1",
'Board 8': "P2*2p/3*3/3*3/***1***/3*3/3*3/p2*2P w 0 1",
'Board 9': "P5p/2*1*2/1*3*1/7/1*3*1/2*1*2/p5P w 0 1",
"Board 10": "P2*2p/7/1*3*1/*5*/1*3*1/7/p2*2P w 0 1",
"Board 11": "P1*1*1p/7/*2*2*/7/*2*2*/7/p1*1*1P w 0 1",
"Board 12": "P1*1*1p/7/2*1*2/1*3*1/2*1*2/7/p1*1*1P w 0 1",
"Board 13": "P2*2p/2*1*2/1*3*1/*5*/1*3*1/2*1*2/p2*2P w 0 1",
"Board 14": "P1*1*1p/1*3*1/*5*/7/*5*/1*3*1/p1*1*1P w 0 1",
"Board 15": "P1*1*1p/7/*1*1*1*/7/*1*1*1*/7/p1*1*1P w 0 1",
"Board 16": "P2*2p/7/1**1**1/**3**/1**1**1/7/p2*2P w 0 1",
"Board 17": "P1*1*1p/2*1*2/*5*/*2*2*/*5*/2*1*2/p1*1*1P w 0 1",
"Board 18": "P5p/2*1*2/**1*1**/3*3/**1*1**/2*1*2/p5P w 0 1",
"Board 19": "P1***1p/7/**1*1**/*5*/**1*1**/7/p1***1P w 0 1",
}
}),
chess: variant({
name: "chess", tooltip: "Chess, unmodified, as it's played by FIDE standards.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
chess960: true, icon: "M", icon960: "V",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
alternateStart: {
'': "",
'PawnsPushed': "rnbqkbnr/8/8/pppppppp/PPPPPPPP/8/8/RNBQKBNR w KQkq - 0 1",
'PawnsPassed': "rnbqkbnr/8/8/PPPPPPPP/pppppppp/8/8/RNBQKBNR w KQkq - 0 1",
'UpsideDown': "RNBKQBNR/PPPPPPPP/8/8/8/8/pppppppp/rnbkqbnr w - - 0 1",
'Theban': "1p6/2p3kn/3p2pp/4pppp/5ppp/8/PPPPPPPP/PPPPPPKN w - - 0 1",
'No castle': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1'
},
}),
bughouse: variant({
name: "bughouse", tooltip: "bughousebughousebughousebughouse.", displayName: "bughouse",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[] w KQkq - 0 1",
chess960: true, icon: "¢", icon960: "⌀", twoBoards: true,
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
pocket: {
roles: ["p", "n", "b", "r", "q"],
pieceNames: {
'p-piece': _('pawn'),
'n-piece': _('knight'),
'b-piece': _('bishop'),
'r-piece': _('rook'),
'q-piece': _('queen'),
},
captureToHand: true,
},
rules: { enPassant: true },
ui: { showPromoted: true },
alternateStart: {
'': "",
'PawnsPushed': "rnbqkbnr/8/8/pppppppp/PPPPPPPP/8/8/RNBQKBNR[] w KQkq - 0 1 | rnbqkbnr/8/8/pppppppp/PPPPPPPP/8/8/RNBQKBNR[] w KQkq - 0 1",
'PawnsPassed': "rnbqkbnr/8/8/PPPPPPPP/pppppppp/8/8/RNBQKBNR[] w KQkq - 0 1 | rnbqkbnr/8/8/PPPPPPPP/pppppppp/8/8/RNBQKBNR[] w KQkq - 0 1",
'UpsideDown': "RNBKQBNR/PPPPPPPP/8/8/8/8/pppppppp/rnbkqbnr[] w - - 0 1 | RNBKQBNR/PPPPPPPP/8/8/8/8/pppppppp/rnbkqbnr[] w - - 0 1",
'Theban': "1p6/2p3kn/3p2pp/4pppp/5ppp/8/PPPPPPPP/PPPPPPKN[] w - - 0 1 | 1p6/2p3kn/3p2pp/4pppp/5ppp/8/PPPPPPPP/PPPPPPKN[] w - - 0 1",
'No castle': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[] w - - 0 1 | rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[] w - - 0 1'
},
}),
crazyhouse: variant({
name: "crazyhouse", tooltip: "Take captured pieces and drop them back on to the board as your own.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[] w KQkq - 0 1",
chess960: true, icon: "+", icon960: "%",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
pocket: {
roles: ["p", "n", "b", "r", "q"],
captureToHand: true,
},
rules: { enPassant: true },
alternateStart: {
'': "",
'PawnsPushed': "rnbqkbnr/8/8/pppppppp/PPPPPPPP/8/8/RNBQKBNR[] w KQkq - 0 1",
'PawnsPassed': "rnbqkbnr/8/8/PPPPPPPP/pppppppp/8/8/RNBQKBNR[] w KQkq - 0 1",
'UpsideDown': "RNBKQBNR/PPPPPPPP/8/8/8/8/pppppppp/rnbkqbnr[] w - - 0 1",
'Theban': "1p6/2p3kn/3p2pp/4pppp/5ppp/8/PPPPPPPP/PPPPPPKN[] w - - 0 1",
'No castle': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[] w - - 0 1'
},
}),
placement: variant({
name: "placement", tooltip: "Choose where your pieces start.",
startFen: "8/pppppppp/8/8/8/8/PPPPPPPP/8[KQRRBBNNkqrrbbnn] w - - 0 1",
icon: "S",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
pocket: { roles: ["n", "b", "r", "q", "k"], captureToHand: false },
rules: { enPassant: true },
}),
atomic: variant({
name: "atomic", tooltip: "Pieces explode upon capture.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
chess960: true, icon: "~", icon960: "\\",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
ui: { pieceSound: "atomic" },
}),
kingofthehill: variant({
name: "kingofthehill", displayName: "king of the hill", tooltip: "Bring your King to the center to win the game.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
chess960: true, icon: "🏴", icon960: "🏁",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
ui: { boardMark: 'kingofthehill' },
}),
'3check': variant({
name: "3check", displayName: "three-check", tooltip: "Check your opponent 3 times to win the game.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 3+3 0 1",
chess960: true, icon: "☰", icon960: "☷",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
ui: { showCheckCounters: true },
alternateStart: {
'': "",
'5check': "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 5+5 0 1",
},
}),
antichess: variant({
name: "antichess", tooltip: "Lose all your pieces to win.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
chess960: true, icon: "🐥", icon960: "🐓",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
}),
racingkings: variant({
name: "racingkings", displayName: "racing kings", display960: '1440', tooltip: "Race your King to the eighth rank to win.",
startFen: "8/8/8/8/8/8/krbnNBRK/qrbnNBRQ w - - 0 1",
chess960: true, icon: "🚗", icon960: "🚙",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
ui: { boardMark: 'racingkings' },
}),
horde: variant({
name: "horde", tooltip: "Destroy the horde to win!",
startFen: "rnbqkbnr/pppppppp/8/1PP2PP1/PPPPPPPP/PPPPPPPP/PPPPPPPP/PPPPPPPP w kq - 0 1",
chess960: true, icon: "🐖", icon960: "🐷",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: { "white": ["p"], "black": ["k", "q", "r", "b", "n", "p"] },
rules: { enPassant: true },
}),
duck: variant({
name: "duck", tooltip: "The duck must be moved to a new square after every turn.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
icon: "🦆",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: { white: ["k", "q", "r", "b", "n", "p", "*"], black: ["k", "q", "r", "b", "n", "p"] },
rules: { enPassant: true, duck: true },
}),
alice: variant({
name: "alice", tooltip: "Through the Looking-Glass",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
icon: "👧",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: false },
alternateStart: {
'': "",
'Looking glass': "|r|n|b|q|k|b|n|r/|p|p|p|p|p|p|p|p/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1",
},
// For Alice chess other board pieces we use promoted pieces to let them style differently,
ui: { boardMark: 'alice' },
}),
fogofwar: variant({
name: "fogofwar", displayName: "fog of war", tooltip: "Players can only see the squares to which their pieces can legally move to.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
icon: "🌫",
boardFamily: "standard8x8", pieceFamily: "standard",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
}),
makruk: variant({
name: "makruk", tooltip: "Thai Chess. A game closely resembling the original Chaturanga. Similar to Chess but with a different queen and bishop.",
startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w - - 0 1",
icon: "Q",
boardFamily: "makruk8x8", pieceFamily: "makruk",
pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter],
promotion: { type: "regular", order: ["m"] },
ui: { counting: "makruk", showPromoted: true },
}),
makrukhouse: variant({
name: "makrukhouse", tooltip: "Take captured pieces and drop them back on to the board as your own.",
startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1",
icon: "Q",
boardFamily: "makruk8x8", pieceFamily: "makruk",
pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter],
promotion: { type: "regular", order: ["m"] },
pocket: {
roles: ["p", "m", "s", "n", "r"],
captureToHand: true,
},
}),
makbug: variant({
name: "makbug", tooltip: "Thai bughouse chess", displayName: "makbug ᴮᴱᵀᴬ",
startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1",
icon: "Q", twoBoards: true,
boardFamily: "makruk8x8", pieceFamily: "makruk",
pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter],
promotion: { type: "regular", order: ["m"] },
pocket: {
roles: ["p", "m", "s", "n", "r"],
pieceNames: {
'p-piece': _('pawn'),
'm-piece': _('queen'),
's-piece': _('bishop'),
'n-piece': _('knight'),
'r-piece': _('rook'),
},
captureToHand: true,
},
ui: { showPromoted: true },
}),
makpong: variant({
name: "makpong", tooltip: "Makruk variant where kings cannot move to escape out of check.",
startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w - - 0 1",
icon: "O",
boardFamily: "makruk8x8", pieceFamily: "makruk",
pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter],
promotion: { type: "regular", order: ["m"] },
ui: { counting: "makruk", showPromoted: true },
}),
cambodian: variant({
name: "cambodian", displayName: "ouk chaktrang", tooltip: "Cambodian Chess. Makruk with a few additional opening abilities.",
startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w DEde - 0 1",
icon: "!",
boardFamily: "makruk8x8", pieceFamily: "makruk",
pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter],
promotion: { type: "regular", order: ["m"] },
ui: { counting: "makruk", showPromoted: true },
}),
sittuyin: variant({
name: "sittuyin", tooltip: "Burmese Chess. Similar to Makruk, but pieces are placed at the start of the match.",
startFen: "8/8/4pppp/pppp4/4PPPP/PPPP4/8/8[KFRRSSNNkfrrssnn] w - - 0 1",
icon: ":",
boardFamily: "sittuyin8x8", pieceFamily: "sittuyin",
colors: { first: "Red", second: "Black" },
pieceRow: ["k", "f", "s", "n", "r", "p"],
pocket: { roles: ["r", "n", "s", "f", "k"], captureToHand: false },
promotion: { type: "regular", order: ["f"] },
}),
asean: variant({
name: "asean", tooltip: "Makruk using the board/pieces from International Chess as well as pawn promotion rules.",
startFen: "rnbqkbnr/8/pppppppp/8/8/PPPPPPPP/8/RNBQKBNR w - - 0 1",
icon: "♻",
boardFamily: "standard8x8", pieceFamily: "asean",
pieceRow: ["k", "q", "b", "n", "r", "p"],
promotion: { type: "regular", order: ["r", "n", "b", "q"] },
ui: { counting: "asean" },
}),
shogi: variant({
name: "shogi", tooltip: "Japanese Chess, the standard 9x9 version played today with drops and promotions.",
startFen: "lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] w 0 1",
icon: "K",
boardFamily: "shogi9x9", pieceFamily: "shogi",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "g", "r", "b", "s", "n", "l", "p"],
pocket: { roles: ["p", "l", "n", "s", "g", "b", "r"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "l", "n", "s", "r", "b"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
alternateStart: {
'': '',
'Lance HC': 'lnsgkgsn1/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'Bishop HC': 'lnsgkgsnl/1r7/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'Rook HC': 'lnsgkgsnl/7b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'Rook+Lance HC': 'lnsgkgsn1/7b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'2-Piece HC': 'lnsgkgsnl/9/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'4-Piece HC': '1nsgkgsn1/9/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'6-Piece HC': '2sgkgs2/9/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'8-Piece HC': '3gkg3/9/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'9-Piece HC': '3gk4/9/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1',
'10-Piece HC': '4k4/9/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] b 0 1'
},
}),
cannonshogi: variant({
name: "cannonshogi", displayName: "cannon shogi", tooltip: "Shogi with Chinese and Korean cannons",
startFen: "lnsgkgsnl/1rci1uab1/p1p1p1p1p/9/9/9/P1P1P1P1P/1BAU1ICR1/LNSGKGSNL[-] w 0 1",
icon: "💣",
boardFamily: "shogi9x9", pieceFamily: "cannonshogi",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "g", "r", "b", "s", "n", "l", "p", "u", "a", "c", "i"],
pocket: { roles: ["p", "l", "n", "s", "g", "b", "r", "u", "a", "c", "i"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "l", "n", "s", "r", "b", "u", "a", "c", "i"] },
rules: { defaultTimeControl: "byoyomi" },
ui: { pieceSound: "shogi" },
}),
minishogi: variant({
name: "minishogi", tooltip: "5x5 Shogi for more compact and faster games. There are no knights or lances.",
startFen: "rbsgk/4p/5/P4/KGSBR[-] w 0 1",
icon: "6",
boardFamily: "shogi5x5", pieceFamily: "shogi",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "g", "r", "b", "s", "p"],
pocket: { roles: ["p", "s", "g", "b", "r"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "s", "r", "b"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
}),
kyotoshogi: variant({
name: "kyotoshogi", displayName: "kyoto shogi", tooltip: "A wild Shogi variant on a 5x5 board where pieces flip into a different piece after each move.",
startFen: "p+nks+l/5/5/5/+LSK+NP[-] w 0 1",
icon: ")",
boardFamily: "shogi5x5", pieceFamily: "kyoto",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "l", "s", "n", "p"],
pocket: { roles: ["p", "l", "n", "s"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "l", "n", "s"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
}),
dobutsu: variant({
name: "dobutsu", tooltip: "3x4 game with cute animals, designed to teach children how to play Shogi.",
startFen: "gle/1c1/1C1/ELG[-] w 0 1",
icon: "8",
boardFamily: "shogi3x4", pieceFamily: "dobutsu",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["l", "g", "e", "c"],
kingRoles: ["l"],
pocket: { roles: ["e", "g", "c"], captureToHand: true },
promotion: { type: "shogi", roles: ["c"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
}),
gorogoro: variant({
name: "gorogoro", tooltip: "5x6 Shogi designed to introduce tactics with the generals.",
startFen: "sgkgs/5/1ppp1/1PPP1/5/SGKGS[-] w 0 1",
icon: "🐱",
boardFamily: "shogi5x6", pieceFamily: "shogi",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "g", "s", "p"],
pocket: { roles: ["p", "s", "g"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "s"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
}),
gorogoroplus: variant({
name: "gorogoroplus", displayName: "gorogoro+", tooltip: "5x6 Shogi designed to introduce tactics with the generals.",
startFen: "sgkgs/5/1ppp1/1PPP1/5/SGKGS[LNln] w 0 1",
icon: "🐱",
boardFamily: "shogi5x6", pieceFamily: "shogi",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "g", "s", "n", "l", "p"],
pocket: { roles: ["p", "l", "n", "s", "g"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "s", "n", "l"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
alternateStart: {
'Gorogoro Plus N+L': '',
'Original (No N+L)': 'sgkgs/5/1ppp1/1PPP1/5/SGKGS[-] w 0 1'
},
}),
torishogi: variant({
name: "torishogi", displayName: "tori shogi", tooltip: "A confrontational 7x7 variant with unique pieces each named after different birds.",
startFen: "rpckcpl/3f3/sssssss/2s1S2/SSSSSSS/3F3/LPCKCPR[-] w 0 1",
icon: "🐦",
boardFamily: "shogi7x7", pieceFamily: "tori",
notation: cg.Notation.SHOGI_ARBNUM,
colors: { first: "Black", second: "White" },
pieceRow: ["k", "c", "p", "l", "r", "f", "s"],
pocket: { roles: ["s", "p", "l", "r", "c", "f"], captureToHand: true },
promotion: { type: "shogi", roles: ["s", "f"] },
rules: { defaultTimeControl: "byoyomi", noDrawOffer: true },
ui: { pieceSound: "shogi" },
alternateStart: {
'': '',
'Left Quail HC': 'rpckcp1/3f3/sssssss/2s1S2/SSSSSSS/3F3/LPCKCPR[] b 0 1',
'Falcon HC': 'rpckcpl/7/sssssss/2s1S2/SSSSSSS/3F3/LPCKCPR[] b 0 1',
'Falcon + Left Quail HC': 'rpckcp1/7/sssssss/2s1S2/SSSSSSS/3F3/LPCKCPR[] b 0 1',
'Falcon + Both Quails HC': '1pckcp1/7/sssssss/2s1S2/SSSSSSS/3F3/LPCKCPR[] b 0 1',
},
}),
xiangqi: variant({
name: "xiangqi", tooltip: "Chinese Chess, one of the oldest and most played board games in the world.",
startFen: "rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1",
icon: "|",
boardFamily: "xiangqi9x10", pieceFamily: "xiangqi",
notation: cg.Notation.XIANGQI_ARBNUM,
colors: { first: "Red", second: "Black" },
pieceRow: ["k", "a", "c", "r", "b", "n", "p"],
promotion: { type: "regular", roles: [] },
}),
xiangqihouse: variant({
name: "xiangqihouse", tooltip: "Take captured pieces and drop them back on to the board as your own.",
startFen: "rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR[] w - - 0 1",
icon: "+",
boardFamily: "xiangqi9x10", pieceFamily: "xiangqi",
notation: cg.Notation.XIANGQI_ARBNUM,
colors: { first: "Red", second: "Black" },
pieceRow: ["k", "a", "c", "r", "b", "n", "p"],
promotion: { type: "regular", roles: [] },
pocket: {
roles: ["p", "n", "b", "r", "c", "a"],
captureToHand: true,
},
}),
supply: variant({
name: "supply", tooltip: "Chinese bughouse chess", displayName: "supply chess ᴮᴱᵀᴬ",
startFen: "rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR[] w - - 0 1",
icon: "¢", twoBoards: true,
boardFamily: "xiangqi9x10", pieceFamily: "xiangqi",
notation: cg.Notation.XIANGQI_ARBNUM,
colors: { first: "Red", second: "Black" },
pieceRow: ["k", "a", "c", "r", "b", "n", "p"],
promotion: { type: "regular", roles: [] },
pocket: {
roles: ["p", "n", "b", "r", "c", "a"],
pieceNames: {
'p-piece': _('pawn'),
'n-piece': _('horse'),
'b-piece': _('elephant'),
'r-piece': _('chariot'),
'c-piece': _('cannon'),
'a-piece': _('advisor'),
},
captureToHand: true,
},
ui: { showPromoted: true },
}),
manchu: variant({
name: "manchu", displayName: "manchu+", tooltip: "Xiangqi variant where one side has a chariot that can also move as a cannon or horse.",
// Manchu+R proved to be balanced
startFen: "m1bakab1r/9/9/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1",
icon: "{",
boardFamily: "xiangqi9x10", pieceFamily: "xiangqi",
notation: cg.Notation.XIANGQI_ARBNUM,
colors: { first: "Red", second: "Black" },
pieceRow: { white: ["k", "a", "c", "r", "b", "n", "p"], black: ["k", "a", "m", "r", "b", "p"] },
promotion: { type: "regular", roles: [] },
alternateStart: {
'': '',
'Original Manchu': 'rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/9/9/M1BAKAB2 w - - 0 1',
},
}),
janggi: variant({
name: "janggi", tooltip: "Korean Chess, similar to Xiangqi but plays much differently. Tournament rules are used.",
startFen: "rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 0 1",
icon: "=",
boardFamily: "janggi9x10", pieceFamily: "janggi",
notation: cg.Notation.JANGGI,
colors: { first: "Blue", second: "Red" },
pieceRow: ["k", "a", "c", "r", "b", "n", "p"],
promotion: { type: "regular", roles: [] },
rules: { defaultTimeControl: "byoyomi", pass: true, setup: true },
ui: { materialPoint: "janggi" },
alternateStart: {
'': '',
'Central Chariot Setup': 'bnra1arnb/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/BNRA1ARNB w - - 0 1',
},
}),
minixiangqi: variant({
name: "minixiangqi", tooltip: "Compact version of Xiangqi played on a 7x7 board without a river.",
startFen: "rcnkncr/p1ppp1p/7/7/7/P1PPP1P/RCNKNCR w - - 0 1",
icon: "7",
boardFamily: "xiangqi7x7", pieceFamily: "xiangqi",
notation: cg.Notation.XIANGQI_ARBNUM,
colors: { first: "Red", second: "Black" },
pieceRow: ["k", "c", "r", "n", "p"],
promotion: { type: "regular", roles: [] },
}),
shatranj: variant({
name: "shatranj", displayName: "shatranj", tooltip: "Ancient Arabian and Persian form of Chess.",
startFen: "rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR w - - 0 1",
icon: "🐘",
boardFamily: "makruk8x8", pieceFamily: "shatranj",
pieceRow: ["k", "q", "r", "b", "n", "p"],
promotion: { type: "regular", order: ["q"] },
alternateStart: {
'': "",
'Chaturanga': "rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1",
},
}),
capablanca: variant({
name: "capablanca", tooltip: "Play with the hybrid pieces, archbishop (B+N) and chancellor (R+N), on a 10x8 board.",
startFen: "rnabqkbcnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNABQKBCNR w KQkq - 0 1",
chess960: true, icon: "P", icon960: ",",
boardFamily: "standard10x8", pieceFamily: "capa",
pieceRow: ["k", "q", "c", "a", "r", "b", "n", "p"],
rules: { enPassant: true },
alternateStart: {
'': '',
'Bird': 'rnbcqkabnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNBCQKABNR w KQkq - 0 1',
'Carrera': 'ranbqkbncr/pppppppppp/10/10/10/10/PPPPPPPPPP/RANBQKBNCR w KQkq - 0 1',
'Conservative': 'arnbqkbnrc/pppppppppp/10/10/10/10/PPPPPPPPPP/ARNBQKBNRC w KQkq - 0 1',
'Embassy': 'rnbqkcabnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNBQKCABNR w KQkq - 0 1',
'Gothic': 'rnbqckabnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNBQCKABNR w KQkq - 0 1',
'Grotesque': 'rbqnkcnabr/pppppppppp/10/10/10/10/PPPPPPPPPP/RBQNKCNABR w KQkq - 0 1',
'Schoolbook': 'rqnbakbncr/pppppppppp/10/10/10/10/PPPPPPPPPP/RQNBAKBNCR w KQkq - 0 1',
'Univers': 'rbncqkanbr/pppppppppp/10/10/10/10/PPPPPPPPPP/RBNCQKANBR w KQkq - 0 1',
'Victorian': 'crnbakbnrq/pppppppppp/10/10/10/10/PPPPPPPPPP/CRNBAKBNRQ w KQkq - 0 1',
},
}),
capahouse: variant({
name: "capahouse", tooltip: "Capablanca with Crazyhouse drop rules.",
startFen: "rnabqkbcnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNABQKBCNR[] w KQkq - 0 1",
chess960: true, icon: "&", icon960: "'",
boardFamily: "standard10x8", pieceFamily: "capa",
pieceRow: ["k", "q", "c", "a", "r", "b", "n", "p"],
pocket: { roles: ["p", "n", "b", "r", "a", "c", "q"], captureToHand: true },
rules: { enPassant: true },
alternateStart: {
'': '',
'Bird': 'rnbcqkabnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNBCQKABNR[] w KQkq - 0 1',
'Carrera': 'ranbqkbncr/pppppppppp/10/10/10/10/PPPPPPPPPP/RANBQKBNCR[] w KQkq - 0 1',
'Conservative': 'arnbqkbnrc/pppppppppp/10/10/10/10/PPPPPPPPPP/ARNBQKBNRC[] w KQkq - 0 1',
'Embassy': 'rnbqkcabnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNBQKCABNR[] w KQkq - 0 1',
'Gothic': 'rnbqckabnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNBQCKABNR[] w KQkq - 0 1',
'Grotesque': 'rbqnkcnabr/pppppppppp/10/10/10/10/PPPPPPPPPP/RBQNKCNABR[] w KQkq - 0 1',
'Schoolbook': 'rqnbakbncr/pppppppppp/10/10/10/10/PPPPPPPPPP/RQNBAKBNCR[] w KQkq - 0 1',
'Univers': 'rbncqkanbr/pppppppppp/10/10/10/10/PPPPPPPPPP/RBNCQKANBR[] w KQkq - 0 1',
'Victorian': 'crnbakbnrq/pppppppppp/10/10/10/10/PPPPPPPPPP/CRNBAKBNRQ[] w KQkq - 0 1',
},
}),
dragon: variant({
name: "dragon", displayName: "dragon chess", tooltip: "The dragon can be dropped to the base rank.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[Dd] w KQkq - 0 1",
icon: "🐉",
boardFamily: "standard8x8", pieceFamily: "dragon",
pieceRow: ["k", "q", "d", "r", "b", "n", "p"],
pocket: { roles: ["d"], captureToHand: false },
promotion: { type: "regular", order: ["q", "d", "n", "r", "b"] },
rules: { enPassant: true },
}),
seirawan: variant({
name: "seirawan", displayName: "s-chess", tooltip: "Hybrid pieces, the hawk (B+N) and elephant (R+N), can enter the board after moving a back rank piece.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[HEhe] w KQBCDFGkqbcdfg - 0 1",
icon: "L", chess960: true, icon960: "}",
boardFamily: "standard8x8", pieceFamily: "seirawan",
pieceRow: ["k", "q", "e", "h", "r", "b", "n", "p"],
pocket: { roles: ["h", "e"], captureToHand: false },
rules: { enPassant: true, gate: true },
}),
shouse: variant({
name: "shouse", displayName: "s-house", tooltip: "S-Chess with Crazyhouse drop rules.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[HEhe] w KQBCDFGkqbcdfg - 0 1",
icon: "$",
boardFamily: "standard8x8", pieceFamily: "seirawan",
pieceRow: ["k", "q", "e", "h", "r", "b", "n", "p"],
pocket: { roles: ["p", "n", "b", "r", "h", "e", "q"], captureToHand: true },
rules: { enPassant: true, gate: true },
}),
grand: variant({
name: "grand", tooltip: "Play with the hybrid pieces, archbishop (B+N) and chancellor (R+N), on a grand 10x10 board.",
startFen: "r8r/1nbqkcabn1/pppppppppp/10/10/10/10/PPPPPPPPPP/1NBQKCABN1/R8R w - - 0 1",
icon: "(",
boardFamily: "grand10x10", pieceFamily: "capa",
pieceRow: ["k", "q", "c", "a", "r", "b", "n", "p"],
rules: { enPassant: true },
}),
grandhouse: variant({
name: "grandhouse", tooltip: "Grand Chess with Crazyhouse drop rules.",
startFen: "r8r/1nbqkcabn1/pppppppppp/10/10/10/10/PPPPPPPPPP/1NBQKCABN1/R8R[] w - - 0 1",
icon: "*",
boardFamily: "grand10x10", pieceFamily: "capa",
pieceRow: ["k", "q", "c", "a", "r", "b", "n", "p"],
pocket: { roles: ["p", "n", "b", "r", "a", "c", "q"], captureToHand: true },
rules: { enPassant: true },
}),
shako: variant({
name: "shako", tooltip: "Introduces the cannon and elephant from Xiangqi into a 10x10 chess board.",
startFen: "c8c/ernbqkbnre/pppppppppp/10/10/10/10/PPPPPPPPPP/ERNBQKBNRE/C8C w KQkq - 0 1",
icon: "9",
boardFamily: "standard10x10", pieceFamily: "shako",
pieceRow: ["k", "q", "e", "c", "r", "b", "n", "p"],
promotion: { type: "regular", order: ["q", "n", "c", "r", "e", "b"] },
rules: { enPassant: true },
alternateStart: {
'': '',
'Setup similar to Xiangqi': 'rnbeqkebnr/10/1c6c1/p1p1pp1p1p/10/10/P1P1PP1P1P/1C6C1/10/RNBEQKEBNR w - - 0 1',
},
}),
shogun: variant({
name: "shogun", tooltip: "Pieces promote and can be dropped, similar to Shogi.",
startFen: "rnb+fkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNB+FKBNR w KQkq - 0 1",
icon: "-",
boardFamily: "shogun8x8", pieceFamily: "shogun",
pieceRow: ["k", "f", "r", "b", "n", "p"],
pocket: { roles: ["p", "n", "b", "r", "f"], captureToHand: true },
promotion: { type: "shogi", roles: ["p", "f", "r", "b", "n"] },
rules: {defaultTimeControl: "byoyomi", enPassant: true },
}),
hoppelpoppel: variant({
name: "hoppelpoppel", displayName: "hoppel-poppel", tooltip: "Knights capture as bishops; bishops capture as knights.",
startFen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
icon: "`",
boardFamily: "standard8x8", pieceFamily: "hoppel",
pieceRow: ["k", "q", "r", "b", "n", "p"],
rules: { enPassant: true },
}),
orda: variant({
name: "orda", tooltip: "Asymmetric variant where one army has pieces that move like knights but capture differently.",
startFen: "lhaykahl/8/pppppppp/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1",
icon: "R",
boardFamily: "standard8x8", pieceFamily: "orda",
colors: { first: "White", second: "Gold" },
pieceRow: { white: ["k", "q", "r", "b", "n", "p", "h"], black: ["k", "y", "l", "a", "h", "p", "q"] },
promotion: { type: "regular", order: ["q", "h"] },
rules: { enPassant: true },
ui: { boardMark: 'campmate' },
}),
khans: variant({
name: "khans", tooltip: "Orda Chess variant. The scout and khatun replaces the pawn and yurt.",
startFen: "lhatkahl/ssssssss/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1",
icon: "🐎",
boardFamily: "standard8x8", pieceFamily: "khans",
colors: { first: "White", second: "Gold" },
pieceRow: { black: ["k", "t", "l", "a", "h", "s"], white: ["k", "q", "r", "b", "n", "p"] },
promotion: { type: "regular" },
rules: { enPassant: true },
ui: { boardMark: 'campmate' },
}),