pub fn generate_randomgrid_balanced(cellsize: f32, dimensions:graphics::Rect) -> Vec<Vec<T>> {
        // Calculate the number of rows and columns in the grid
        let rows = dimensions.w / cellsize;
        let cols = dimensions.h / cellsize;

        // Create a new vector (represents rows)
        let mut gridvector = Vec::new();

        // Iterate for each row
        for _ in 0..(rows as i32) {
            // Create a new vector (represents columns)
            let mut column = Vec::new();
            // Iterate for each column
            for _ in 0..(cols as i32) {
                // Create a new cell with the balanced randomizer 
                // and push it into the column vector
                column.push(T::balanced());
            }

            // Push the column vector into the row vector (grid)
            gridvector.push(column);
        }  

        // Return the grid vector
        return gridvector
    }
/// A function that creates a randomized grid of cells for the given cell size and grid dimensions. 
/// All cell states have an equal probability of occuring on the grid.
A function that creates a randomized grid of cells for the given cell size and grid dimensions.
All cell states have an equal probability of occuring on the grid.
A function that creates a randomized grid of cells for the given cell size and grid dimensions . All cell states have an equal probability of occuring on the grid .
pub fn generate_randomgrid_balanced(cellsize: f32, dimensions:graphics::Rect) -> Vec<Vec<T>> {
        // Calculate the number of rows and columns in the grid
        let rows = dimensions.w / cellsize;
        let cols = dimensions.h / cellsize;
        // Create a new vector (represents rows)
        let mut gridvector = Vec::new();
        // Iterate for each row
        for _ in 0..(rows as i32) {
            // Create a new vector (represents columns)
            let mut column = Vec::new();
            // Iterate for each column
            for _ in 0..(cols as i32) {
                // Create a new cell with the balanced randomizer 
                // and push it into the column vector
                column.push(T::balanced());
            }
            // Push the column vector into the row vector (grid)
            gridvector.push(column);
        }  
        // Return the grid vector
        return gridvector
    }
pub fn generate_randomgrid_balanced ( cellsize : f32 , dimensions : graphics :: Rect ) -> Vec < Vec < T > > { // Calculate the number of rows and columns in the grid let rows = dimensions . w / cellsize ; let cols = dimensions . h / cellsize ; // Create a new vector (represents rows) let mut gridvector = Vec :: new ( ) ; // Iterate for each row for _ in 0 .. ( rows as i32 ) { // Create a new vector (represents columns) let mut column = Vec :: new ( ) ; // Iterate for each column for _ in 0 .. ( cols as i32 ) { // Create a new cell with the balanced randomizer  // and push it into the column vector column . push ( T :: balanced ( ) ) ; } // Push the column vector into the row vector (grid) gridvector . push ( column ) ; } // Return the grid vector return gridvector }
A function that creates a randomized grid of cells for the given cell size and grid dimensions.
A function that creates a randomized grid of cells for the given cell size and grid dimensions .
cellsize
f32
dimensions
graphics::Rect
cellsize
f32
dimensions
graphics::Rect