libs/chessx-pgn/guess/common.h
// square_Adjacent: returns 1 if the two squares are adjacent. Note that
//    diagonal adjacency is included: a1 and b2 are adjacent.
//    Also note that a square is adjacent to itself.

returns 1 if the two squares are adjacent. Note that
diagonal adjacency is included: a1 and b2 are adjacent.
Also note that a square is adjacent to itself.
returns 1 if the two squares are adjacent . Note that diagonal adjacency is included : a1 and b2 are adjacent . Also note that a square is adjacent to itself .
inline bool
square_Adjacent(squareT from, squareT to)
{
    ASSERT(from <= H8  &&  to <= H8);
    rankT fromRank = square_Rank(from);
    rankT toRank = square_Rank(to);
    int rdist = (int)fromRank - (int)toRank;
    if(rdist < -1  ||  rdist > 1)
    {
        return false;
    }
    fyleT fromFyle = square_Fyle(from);
    fyleT toFyle = square_Fyle(to);
    int fdist = (int)fromFyle - (int)toFyle;
    if(fdist < -1  ||  fdist > 1)
    {
        return false;
    }
    return true;
}
inline bool square_Adjacent ( squareT from , squareT to ) { ASSERT ( from <= H8 && to <= H8 ) ; rankT fromRank = square_Rank ( from ) ; rankT toRank = square_Rank ( to ) ; int rdist = ( int ) fromRank - ( int ) toRank ; if ( rdist < -1 || rdist > 1 ) { return false ; } fyleT fromFyle = square_Fyle ( from ) ; fyleT toFyle = square_Fyle ( to ) ; int fdist = ( int ) fromFyle - ( int ) toFyle ; if ( fdist < -1 || fdist > 1 ) { return false ; } return true ; }
square_Adjacent: returns 1 if the two squares are adjacent.
square_Adjacent : returns 1 if the two squares are adjacent .