libs/chessx-pgn/guess/common.h
// square_Distance:
//   Return the distance in king moves between two squares.

Return the distance in king moves between two squares.
Return the distance in king moves between two squares .
inline unsigned int
square_Distance(squareT from, squareT to)
{
    ASSERT(from <= H8  &&  to <= H8);
    unsigned int rankd = rankFyleDist[(square_Rank(from) << 3) | square_Rank(to)];
    unsigned int fyled = rankFyleDist[(square_Fyle(from) << 3) | square_Fyle(to)];
    return (rankd > fyled) ? rankd : fyled;
}
inline unsigned int square_Distance ( squareT from , squareT to ) { ASSERT ( from <= H8 && to <= H8 ) ; unsigned int rankd = rankFyleDist [ ( square_Rank ( from ) << 3 ) | square_Rank ( to ) ] ; unsigned int fyled = rankFyleDist [ ( square_Fyle ( from ) << 3 ) | square_Fyle ( to ) ] ; return ( rankd > fyled ) ? rankd : fyled ; }
square_Distance:
Return the distance in king moves between two squares.
square_Distance : Return the distance in king moves between two squares .