pub fn locate(board: &Board, to: Sq, _from: OptSq, team: Team, piece: Piece) -> Option<Sq> {
    for idx in 0..8 {
        if let Some(target) = Sq::try_into(
            to.digit as isize + RANKS[idx],
            to.letter as isize + FILES[idx],
        ) {
            if let Some(sq) = board.legal_target(target, to, team, piece) {
                return Some(sq);
            }
        }
    }

    None
}
// Kings cannot have a 'from' notation as there is only 1 king per side.
Kings cannot have a 'from' notation as there is only 1 king per side.
Kings cannot have a ' from ' notation as there is only 1 king per side .
pub fn locate(board: &Board, to: Sq, _from: OptSq, team: Team, piece: Piece) -> Option<Sq> {
    for idx in 0..8 {
        if let Some(target) = Sq::try_into(
            to.digit as isize + RANKS[idx],
            to.letter as isize + FILES[idx],
        ) {
            if let Some(sq) = board.legal_target(target, to, team, piece) {
                return Some(sq);
            }
        }
    }
    None
}
pub fn locate ( board : & Board , to : Sq , _from : OptSq , team : Team , piece : Piece ) -> Option < Sq > { for idx in 0 .. 8 { if let Some ( target ) = Sq :: try_into ( to . digit as isize + RANKS [ idx ] , to . letter as isize + FILES [ idx ] , ) { if let Some ( sq ) = board . legal_target ( target , to , team , piece ) { return Some ( sq ) ; } } } None }
Kings cannot have a 'from' notation as there is only 1 king per side.
Kings cannot have a ' from ' notation as there is only 1 king per side .
board
&Board
to
Sq
_from
OptSq
team
Team
piece
Piece
board
&Board
to
Sq
_from
OptSq
team
Team
piece
Piece