// Solves part 1: Find first winning board
Solves part 1: Find first winning board
Solves part 1 : Find first winning board
fn solve_first_winning(mut game: Game, all_draws: Vec<u8>) -> u32 {
    let mut i = 0;
    let winning_boards = loop {
        let number = all_draws[i];
        game.draw(number);
        if let Some(board) = game.pop_winners() {
            break board;
        }
        i += 1;
    };
    match &winning_boards[..] {
        [board] => board.calculate_answer(&game.draws),
        _ => panic!("More than one board won first"),
    }
}
fn solve_first_winning ( mut game : Game , all_draws : Vec < u8 > ) -> u32 { let mut i = 0 ; let winning_boards = loop { let number = all_draws [ i ] ; game . draw ( number ) ; if let Some ( board ) = game . pop_winners ( ) { break board ; } i += 1 ; } ; match & winning_boards [ .. ] { [ board ] => board . calculate_answer ( & game . draws ) , _ => panic ! ( " " ) , } }
Solves part 1: Find first winning board
Solves part 1 : Find first winning board
game
Game
all_draws
Vec<u8>