X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=5a4c8b6b82fd6fe5b3330fbbd1d3160ad9352672;hp=aa65d7f812c2814744a48f26f419572d07712429;hb=6fb0a1bc4050dd9b15e9c163c46c60f25c48137d;hpb=8631b08d9704dac256462f6b5b885a4d8b0a9165 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index aa65d7f8..5a4c8b6b 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -177,7 +177,7 @@ void Bitboards::init() { for (Square s2 = SQ_A1; s2 <= SQ_H8; ++s2) if (s1 != s2) { - SquareDistance[s1][s2] = std::max(file_distance(s1, s2), rank_distance(s1, s2)); + SquareDistance[s1][s2] = std::max(distance(s1, s2), distance(s1, s2)); DistanceRingsBB[s1][SquareDistance[s1][s2] - 1] |= s2; } @@ -191,7 +191,7 @@ void Bitboards::init() { { Square to = s + Square(c == WHITE ? steps[pt][i] : -steps[pt][i]); - if (is_ok(to) && square_distance(s, to) < 3) + if (is_ok(to) && distance(s, to) < 3) StepAttacksBB[make_piece(c, pt)][s] |= to; } @@ -229,7 +229,7 @@ namespace { for (int i = 0; i < 4; ++i) for (Square s = sq + deltas[i]; - is_ok(s) && square_distance(s, s - deltas[i]) == 1; + is_ok(s) && distance(s, s - deltas[i]) == 1; s += deltas[i]) { attack |= s;