/// Checks that the given ship position is valid.
///
/// If the player is CPU-controlled, a ship in a space next to another ship
/// will be considered invalid.
Checks that the given ship position is valid.
If the player is CPU-controlled, a ship in a space next to another ship
will be considered invalid.
Checks that the given ship position is valid . If the player is CPU - controlled a ship in a space next to another ship will be considered invalid .
fn valid_ship_position(&self, new_ship: &[[u8; 2]]) -> bool {
        new_ship.iter().all(|s| {
            self.valid_space(s)
                && !self.ship_is_in_space(s)
                && !(self.ship_is_next_to(s) && self.is_cpu)
        })
    }
fn valid_ship_position ( & self , new_ship : & [ [ u8 ; 2 ] ] ) -> bool { new_ship . iter ( ) . all ( | s | { self . valid_space ( s ) && ! self . ship_is_in_space ( s ) && ! ( self . ship_is_next_to ( s ) && self . is_cpu ) } ) }
Checks that the given ship position is valid.
Checks that the given ship position is valid .
&self
new_ship
&[[u8; 2]]