/// Pop the winning boards from the game based on the drawed numbers.
/// This removes the winners from the game. (Note: There might be more than one winner!)
Pop the winning boards from the game based on the drawed numbers.
This removes the winners from the game. (Note: There might be more than one winner!)
Pop the winning boards from the game based on the drawed numbers . This removes the winners from the game . ( Note : There might be more than one winner! )
fn pop_winners(&mut self) -> Option<Vec<Board>> {
        let (winners, remaining): (Vec<Board>, Vec<Board>) =
            self.boards.iter().cloned().partition(|board| {
                board.has_winning_row(&self.draws) || board.has_winning_col(&self.draws)
            });
        self.boards = remaining;
        if winners.is_empty() {
            None
        } else {
            Some(winners)
        }
    }
fn pop_winners ( & mut self ) -> Option < Vec < Board > > { let ( winners , remaining ) : ( Vec < Board > , Vec < Board > ) = self . boards . iter ( ) . cloned ( ) . partition ( | board | { board . has_winning_row ( & self . draws ) || board . has_winning_col ( & self . draws ) } ) ; self . boards = remaining ; if winners . is_empty ( ) { None } else { Some ( winners ) } }
Pop the winning boards from the game based on the drawed numbers.
Pop the winning boards from the game based on the drawed numbers .
&mut self