-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.js
More file actions
166 lines (165 loc) · 10.2 KB
/
error.js
File metadata and controls
166 lines (165 loc) · 10.2 KB
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
error_ok = 0;
error_fromSquareOccupiedToSquareEmpty = 1;
error_unitFrozen = 3;
error_badDirection = 4;
error_blocked = 5;
error_pawnVerticalCannotUncapture = 6;
error_pawnDiagonalMustUncapture = 7;
error_cannotUncapturePawnOnTopBottom = 8;
error_cannotUnpromoteKing = 10;
error_enPassantPawnOnly = 11;
error_enPassantWrongRank = 12;
error_illegalEnPassant = 13;
error_oppositeSideInCheck = 14;
error_moreThanTwoCheckers = 15;
error_checkByPawnOnSecondRank = 16;
error_doubleStepFollowingEpRequired = 17;
error_uncastlingRookNotInPosition = 18;
error_uncastlingSquareOccupied = 19;
error_uncastlingCannotUncastleThroughOrIntoCheck = 20;
error_uncastlingCannotUncapture = 21;
error_cannotUnpromoteOriginal = 22;
error_tooManyWhiteKings = 23;
error_tooManyBlackKings = 24;
error_noWhiteKing = 25;
error_noBlackKing = 26;
error_impossiblePawnStructure = 27;
error_tooManyWhiteCaptures = 28;
error_tooManyBlackCaptures = 29;
error_tooManyCaptures = 30;
error_tooManyWhiteUnits = 31;
error_tooManyBlackUnits = 32;
error_tooManyWhitePawns = 33;
error_tooManyBlackPawns = 34;
error_tooManyPromotedWhiteQueens = 35;
error_tooManyPromotedWhiteRooks = 36;
error_tooManyPromotedWhiteDarkSquareBishops = 37;
error_tooManyPromotedWhiteLightSquareBishops = 38;
error_tooManyPromotedWhiteKnights = 39;
error_tooManyPromotedBlackQueens = 40;
error_tooManyPromotedBlackRooks = 41;
error_tooManyPromotedBlackDarkSquareBishops = 42;
error_tooManyPromotedBlackLightSquareBishops = 43;
error_tooManyPromotedBlackKnights = 44;
error_illegallyPlacedWhiteBishop = 45;
error_illegallyPlacedBlackBishop = 46;
error_illegallyPlacedWhiteRook = 47;
error_illegallyPlacedBlackRook = 48;
error_tooManyPromotedWhitePieces = 49;
error_tooManyPromotedBlackPieces = 50;
error_illegallyPlacedWhiteQueen = 51;
error_illegallyPlacedBlackQueen = 52;
error_illegallyPlacedWhiteKing = 53;
error_illegallyPlacedBlackKing = 54;
error_illegallySwitchedWhiteQueenKing = 55;
error_illegallySwitchedBlackQueenKing = 56;
error_illegalOrderWhiteRookQueenKing = 57;
error_illegalOrderBlackRookQueenKing = 58;
error_illegalDoubleCheck = 59;
error_illegalBishopRookPawnConfiguration = 60;
error_cannotUncaptureKing = 61;
error_whitesTurn = 62;
error_blacksTurn = 63;
error_whiteUnpromoteEighthRank = 64;
error_blackUnpromoteFirstRank = 65;
error_impossiblePromotedWhiteQueen = 66;
error_impossiblePromotedWhiteRook = 67;
error_impossiblePromotedWhiteBishop = 68;
error_impossiblePromotedWhiteKnight = 69;
error_impossiblePromotedBlackQueen = 70;
error_impossiblePromotedBlackRook = 71;
error_impossiblePromotedBlackBishop = 72;
error_impossiblePromotedBlackKnight = 73;
error_impossibleKnownCage = 74;
error_illegalBishopAndPawnInCorner = 75;
error_noWhitePromotionSquaresForQueen = 76;
error_noWhitePromotionSquaresForRook = 77;
error_noWhitePromotionSquaresForBishop = 78;
error_noWhitePromotionSquaresForKnight = 79;
error_noBlackPromotionSquaresForQueen = 80;
error_noBlackPromotionSquaresForRook = 81;
error_noBlackPromotionSquaresForBishop = 82;
error_noBlackPromotionSquaresForKnight = 83;
errorText = [];
errorText[error_ok] = "ok";
errorText[error_fromSquareOccupiedToSquareEmpty] = "Must retract from an occupied square to an empty square.";
errorText[error_unitFrozen] = "That unit is frozen.";
errorText[error_badDirection] = "That unit cannot move in that direction.";
errorText[error_blocked] = "That move is blocked by another unit.";
errorText[error_pawnVerticalCannotUncapture] = "A vertical pawn move cannot uncapture.";
errorText[error_pawnDiagonalMustUncapture] = "A diagonal pawn move must uncapture.";
errorText[error_cannotUncapturePawnOnTopBottom] = "Cannot uncapture a pawn onto the first or eighth rank.";
errorText[error_cannotUnpromoteKing] = "Cannot unpromote a king.";
errorText[error_enPassantPawnOnly] = "En passant uncapture available only for pawns.";
errorText[error_enPassantWrongRank] = "Pawn must be on its sixth rank for an en passant uncapture.";
errorText[error_illegalEnPassant] = "Illegal en passant uncapture.";
errorText[error_oppositeSideInCheck] = "Cannot leave the opposing king in check.";
errorText[error_moreThanTwoCheckers] = "Cannot leave the retractor's king in check by more than 2 units.";
errorText[error_checkByPawnOnSecondRank] = "Cannot leave the retractor's king in check by a pawn on its second rank.";
errorText[error_doubleStepFollowingEpRequired] = "After an en passant uncapture, the uncaptured pawn must retreat 2 squares.";
errorText[error_uncastlingRookNotInPosition] = "Rook is not position to uncastle.";
errorText[error_uncastlingSquareOccupied] = "Target or intermediate squares for uncastling are occupied.";
errorText[error_uncastlingCannotUncastleThroughOrIntoCheck] = "Cannot uncastle through, or into, check.";
errorText[error_uncastlingCannotUncapture] = "Cannot uncapture when uncastling.";
errorText[error_cannotUnpromoteOriginal] = "Cannot unpromote an original piece.";
errorText[error_tooManyWhiteKings] = "Too many white kings on the board.";
errorText[error_tooManyBlackKings] = "Too many black kings on the board.";
errorText[error_noWhiteKing] = "No white king on the board.";
errorText[error_noBlackKing] = "No black king on the board.";
errorText[error_impossiblePawnStructure] = "Impossible pawn structure.";
errorText[error_tooManyWhiteCaptures] = "Too many white captures or impossible pawn structure.";
errorText[error_tooManyBlackCaptures] = "Too many black captures or impossible pawn structure.";
errorText[error_tooManyCaptures] = "Too many captures or impossible pawn structure.";
errorText[error_tooManyWhiteUnits] = "More than 16 white units.";
errorText[error_tooManyBlackUnits] = "More than 16 black units.";
errorText[error_tooManyWhitePawns] = "More than 8 white pawns.";
errorText[error_tooManyBlackPawns] = "More than 8 black pawns.";
errorText[error_tooManyPromotedWhiteQueens] = "Too many promoted white queens.";
errorText[error_tooManyPromotedWhiteRooks] = "Too many promoted white rooks.";
errorText[error_tooManyPromotedWhiteDarkSquareBishops] = "Too many promoted white dark square bishops.";
errorText[error_tooManyPromotedWhiteLightSquareBishops] = "Too many promoted white light square bishops.";
errorText[error_tooManyPromotedWhiteKnights] = "Too many promoted white knights.";
errorText[error_tooManyPromotedBlackQueens] = "Too many promoted black queens.";
errorText[error_tooManyPromotedBlackRooks] = "Too many promoted black rooks.";
errorText[error_tooManyPromotedBlackDarkSquareBishops] = "Too many promoted black dark square bishops.";
errorText[error_tooManyPromotedBlackLightSquareBishops] = "Too many promoted black light square bishops.";
errorText[error_tooManyPromotedBlackKnights] = "Too many promoted black knights.";
errorText[error_illegallyPlacedWhiteBishop] = "Illegally placed white bishop.";
errorText[error_illegallyPlacedBlackBishop] = "Illegally placed black bishop.";
errorText[error_illegallyPlacedWhiteRook] = "Illegally placed white rook.";
errorText[error_illegallyPlacedBlackRook] = "Illegally placed black rook.";
errorText[error_tooManyPromotedWhitePieces] = "Too many promoted white pieces.";
errorText[error_tooManyPromotedBlackPieces] = "Too many promoted black pieces.";
errorText[error_illegallyPlacedWhiteQueen] = "Illegally placed white queen.";
errorText[error_illegallyPlacedBlackQueen] = "Illegally placed black queen.";
errorText[error_illegallyPlacedWhiteKing] = "Illegally placed white king.";
errorText[error_illegallyPlacedBlackKing] = "Illegally placed black king.";
errorText[error_illegallySwitchedWhiteQueenKing] = "The white queen and king have illegally switched positions on the first rank.";
errorText[error_illegallySwitchedBlackQueenKing] = "The black queen and king have illegally switched positions on the eighth rank.";
errorText[error_illegalOrderWhiteRookQueenKing] = "The order of the white rook(s), queen, king on the first rank is impossible.";
errorText[error_illegalOrderBlackRookQueenKing] = "The order of the black rook(s), queen, king on the eighth rank is impossible.";
errorText[error_illegalDoubleCheck] = "The retractor's king is in an illegal double check.";
errorText[error_illegalBishopRookPawnConfiguration] = "Illegal bishop, rook, pawn configuration.";
errorText[error_cannotUncaptureKing] = "Cannot uncapture a king.";
errorText[error_whitesTurn] = "It is White's turn to retract.";
errorText[error_blacksTurn] = "It is Black's turn to retract."
errorText[error_whiteUnpromoteEighthRank] = "White pieces can only unpromote from the eighth rank.";
errorText[error_blackUnpromoteFirstRank] = "Black pieces can only unpromote from the first rank.";
errorText[error_impossiblePromotedWhiteQueen] = "A white queen marked promoted cannot be.";
errorText[error_impossiblePromotedWhiteRook] = "A white rook marked promoted cannot be.";
errorText[error_impossiblePromotedWhiteBishop] = "A white bishop marked promoted cannot be.";
errorText[error_impossiblePromotedWhiteKnight] = "A white knight marked promoted cannot be.";
errorText[error_impossiblePromotedBlackQueen] = "A black queen marked promoted cannot be.";
errorText[error_impossiblePromotedBlackRook] = "A black rook marked promoted cannot be.";
errorText[error_impossiblePromotedBlackBishop] = "A black bishop marked promoted cannot be.";
errorText[error_impossiblePromotedBlackKnight] = "A black knight marked promoted cannot be.";
errorText[error_impossibleKnownCage] = "The position contains a known cage.";
errorText[error_illegalBishopAndPawnInCorner] = "Illegal bishop and pawn configuration in corner.";
errorText[error_noWhitePromotionSquaresForQueen] = "No available promotion squares for a promoted white queen.";
errorText[error_noWhitePromotionSquaresForRook] = "No available promotion squares for a promoted white rook.";
errorText[error_noWhitePromotionSquaresForBishop] = "No available promotion squares for a promoted white bishop.";
errorText[error_noWhitePromotionSquaresForKnight] = "No available promotion squares for a promoted white knight.";
errorText[error_noBlackPromotionSquaresForQueen] = "No available promotion squares for a promoted black queen.";
errorText[error_noBlackPromotionSquaresForRook] = "No available promotion squares for a promoted black rook.";
errorText[error_noBlackPromotionSquaresForBishop] = "No available promotion squares for a promoted black bishop.";
errorText[error_noBlackPromotionSquaresForKnight] = "No available promotion squares for a promoted black knight.";