pub fn update(&mut self, board_from: &GameBoard) {
        if board_from.height != self.height || board_from.width != self.width {
            panic!("two boards have different sizes!");
        }
        for row in 0..board_from.height {
            for col in 0..board_from.width {
                self.board[row][col] = board_from.board[row][col];
            }
        }
    }
// update the game board with the data in a new game board, 
// not taking the new game board's ownership
// need to work on error handling: try avoid using panic!()
update the game board with the data in a new game board,
not taking the new game board's ownership
need to work on error handling: try avoid using panic!()
update the game board with the data in a new game board not taking the new game board ' s ownership need to work on error handling : try avoid using panic! ()
pub fn update(&mut self, board_from: &GameBoard) {
        if board_from.height != self.height || board_from.width != self.width {
            panic!("two boards have different sizes!");
        }
        for row in 0..board_from.height {
            for col in 0..board_from.width {
                self.board[row][col] = board_from.board[row][col];
            }
        }
    }
pub fn update ( & mut self , board_from : & GameBoard ) { if board_from . height != self . height || board_from . width != self . width { panic ! ( " " ) ; } for row in 0 .. board_from . height { for col in 0 .. board_from . width { self . board [ row ] [ col ] = board_from . board [ row ] [ col ] ; } } }
update the game board with the data in a new game board,
not taking the new game board's ownership
need to work on error handling: try avoid using panic!
update the game board with the data in a new game board not taking the new game board ' s ownership need to work on error handling : try avoid using panic!
&mut self
board_from
&GameBoard