File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed
Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ extern Bitboard PassedPawnMask[COLOR_NB][SQUARE_NB];
8080extern Bitboard PawnAttackSpan[COLOR_NB][SQUARE_NB];
8181extern Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB];
8282
83+ extern int SquareDistance[SQUARE_NB][SQUARE_NB];
84+
8385const Bitboard BlackSquares = 0xAA55AA55AA55AA55ULL ;
8486
8587// / Overloads of bitwise operators between a Bitboard and a Square for testing
@@ -105,13 +107,22 @@ inline Bitboard operator^(Bitboard b, Square s) {
105107 return b ^ SquareBB[s];
106108}
107109
108-
109- // / more_than_one() returns true if in 'b' there is more than one bit set
110-
111110inline bool more_than_one (Bitboard b) {
112111 return b & (b - 1 );
113112}
114113
114+ inline int square_distance (Square s1, Square s2) {
115+ return SquareDistance[s1][s2];
116+ }
117+
118+ inline int file_distance (Square s1, Square s2) {
119+ return abs (file_of (s1) - file_of (s2));
120+ }
121+
122+ inline int rank_distance (Square s1, Square s2) {
123+ return abs (rank_of (s1) - rank_of (s2));
124+ }
125+
115126
116127// / shift_bb() moves bitboard one step along direction Delta. Mainly for pawns.
117128
Original file line number Diff line number Diff line change @@ -310,7 +310,6 @@ inline Score operator/(Score s, int i) {
310310#undef ENABLE_SAFE_OPERATORS_ON
311311
312312extern Value PieceValue[PHASE_NB][PIECE_NB];
313- extern int SquareDistance[SQUARE_NB][SQUARE_NB];
314313
315314struct MoveStack {
316315 Move move;
@@ -391,18 +390,6 @@ inline bool opposite_colors(Square s1, Square s2) {
391390 return ((s >> 3 ) ^ s) & 1 ;
392391}
393392
394- inline int file_distance (Square s1, Square s2) {
395- return abs (file_of (s1) - file_of (s2));
396- }
397-
398- inline int rank_distance (Square s1, Square s2) {
399- return abs (rank_of (s1) - rank_of (s2));
400- }
401-
402- inline int square_distance (Square s1, Square s2) {
403- return SquareDistance[s1][s2];
404- }
405-
406393inline char file_to_char (File f, bool tolower = true ) {
407394 return char (f - FILE_A + (tolower ? ' a' : ' A' ));
408395}
You can’t perform that action at this time.
0 commit comments