fn insert_nb(&mut self, nb: BoardNumber) -> Option<usize> {
        for (i, check) in self.grid.iter_mut().enumerate() {
            match *check {
                x if x == nb => {
                    *check = -1;
                    self.sum -= nb as usize;
                    if self.check_win(i) {
                        return Some(self.sum * nb as usize);
                    } else {
                        return None;
                    }
                }
                _ => {}
            }
        }
        None
    }
/// Inserts nb into the board and check the winning condition
/// Returns the board's score when it wons
Inserts nb into the board and check the winning condition
Returns the board's score when it wons
Inserts nb into the board and check the winning condition Returns the board ' s score when it wons
fn insert_nb(&mut self, nb: BoardNumber) -> Option<usize> {
        for (i, check) in self.grid.iter_mut().enumerate() {
            match *check {
                x if x == nb => {
                    *check = -1;
                    self.sum -= nb as usize;
                    if self.check_win(i) {
                        return Some(self.sum * nb as usize);
                    } else {
                        return None;
                    }
                }
                _ => {}
            }
        }
        None
    }
fn insert_nb ( & mut self , nb : BoardNumber ) -> Option < usize > { for ( i , check ) in self . grid . iter_mut ( ) . enumerate ( ) { match * check { x if x == nb => { * check = - 1 ; self . sum -= nb as usize ; if self . check_win ( i ) { return Some ( self . sum * nb as usize ) ; } else { return None ; } } _ => { } } } None }
Inserts nb into the board and check the winning condition
Returns the board's score when it wons
Inserts nb into the board and check the winning condition Returns the board ' s score when it wons
&mut self
nb
BoardNumber