fn attacking_move(state: &State, player: Color, square: Square) -> (bool, bool) {
    let other_player = get_other_player(player);
    if !square_is_on_board(square) {
        return (false, true);
    }
    if square_is_empty(state, square) {
        return (true, false);
    }
    if is_piece_from_player(state, player, square)
        || is_piece_from_player(state, other_player, square)
        || is_king_from_player(state, other_player, square)
    {
        return (true, true);
    }
    panic!("ATTACKING MOVE ERROR");
}
///
/// return squares that are attacked or defended
/// - empty squares
/// - opponent pieces (opponent king is ignored)
/// - own pieces
/// => return [<bool> playable, <bool> stop_iteration]
return squares that are attacked or defended
empty squares
opponent pieces (opponent king is ignored)
own pieces
> return [ playable,  stop_iteration]
return squares that are attacked or defended empty squares opponent pieces ( opponent king is ignored ) own pieces > return [ playable stop_iteration ]
fn attacking_move(state: &State, player: Color, square: Square) -> (bool, bool) {
    let other_player = get_other_player(player);
    if !square_is_on_board(square) {
        return (false, true);
    }
    if square_is_empty(state, square) {
        return (true, false);
    }
    if is_piece_from_player(state, player, square)
        || is_piece_from_player(state, other_player, square)
        || is_king_from_player(state, other_player, square)
    {
        return (true, true);
    }
    panic!("ATTACKING MOVE ERROR");
}
fn attacking_move ( state : & State , player : Color , square : Square ) -> ( bool , bool ) { let other_player = get_other_player ( player ) ; if ! square_is_on_board ( square ) { return ( false , true ) ; } if square_is_empty ( state , square ) { return ( true , false ) ; } if is_piece_from_player ( state , player , square ) || is_piece_from_player ( state , other_player , square ) || is_king_from_player ( state , other_player , square ) { return ( true , true ) ; } panic ! ( " " ) ; }
return squares that are attacked or defended
 empty squares
 opponent pieces (opponent king is ignored)
 own pieces
> return [<bool> playable, <bool> stop_iteration]
return squares that are attacked or defended empty squares opponent pieces ( opponent king is ignored ) own pieces > return [ <bool > playable <bool > stop_iteration ]
state
&State
player
Color
square
Square
state
&State
player
Color
square
Square