use actions::*; use math::*; use state::*; pub fn shoot_randomly(state: &State) -> Action { let mut shot: Point; while { shot = Point::random(state.map_size); let ref target = state.opponent_map.cells[shot.x as usize][shot.y as usize]; target.damaged || target.missed } {} Action::Shoot(shot) }