fn randomcell(&self) -> GridCell<Self::Cell> {
        // Check if grid exists
        if let Some(grid) = &self.vector {
            // Get a random column and row from the grid
            let col = rand::thread_rng().gen_range(0..grid.len());
            let row = rand::thread_rng().gen_range(0..grid[0].len());
            // Build the GridCell and return it
            return (col, row, grid[row][col])
        
        // If the grid is null, panic
        } else {
            panic!("random grid cell selection failed. grid is empty!")
        }
    }
/// A method that returns a random cell from the grid.
/// Returns the x,y position of the cell along with cell state as a GridCell
A method that returns a random cell from the grid.
Returns the x,y position of the cell along with cell state as a GridCell
A method that returns a random cell from the grid . Returns the x y position of the cell along with cell state as a GridCell
fn randomcell(&self) -> GridCell<Self::Cell> {
        // Check if grid exists
        if let Some(grid) = &self.vector {
            // Get a random column and row from the grid
            let col = rand::thread_rng().gen_range(0..grid.len());
            let row = rand::thread_rng().gen_range(0..grid[0].len());
            // Build the GridCell and return it
            return (col, row, grid[row][col])
        // If the grid is null, panic
        } else {
            panic!("random grid cell selection failed. grid is empty!")
        }
    }
fn randomcell ( & self ) -> GridCell < Self :: Cell > { // Check if grid exists if let Some ( grid ) = & self . vector { // Get a random column and row from the grid let col = rand :: thread_rng ( ) . gen_range ( 0 .. grid . len ( ) ) ; let row = rand :: thread_rng ( ) . gen_range ( 0 .. grid [ 0 ] . len ( ) ) ; // Build the GridCell and return it return ( col , row , grid [ row ] [ col ] ) // If the grid is null, panic } else { panic ! ( " " ) } }
A method that returns a random cell from the grid.
A method that returns a random cell from the grid .
&self
&self