fn change_distribution(percent_pop: usize, canvas: &mut WindowCanvas) -> RandomCells {
    let title = format!("rust-d3-life demo {}x{} {}%", GRID_SIZE, GRID_SIZE, percent_pop);
    canvas.window_mut().set_title(&title).unwrap();
    let limit = (GRID_SIZE * GRID_SIZE) * percent_pop / 100;
    RandomCells::new(limit, GRID_SIZE * GRID_SIZE)
}
// change the distribution of alive and dead cells
change the distribution of alive and dead cells
change the distribution of alive and dead cells
fn change_distribution(percent_pop: usize, canvas: &mut WindowCanvas) -> RandomCells {
    let title = format!("rust-d3-life demo {}x{} {}%", GRID_SIZE, GRID_SIZE, percent_pop);
    canvas.window_mut().set_title(&title).unwrap();
    let limit = (GRID_SIZE * GRID_SIZE) * percent_pop / 100;
    RandomCells::new(limit, GRID_SIZE * GRID_SIZE)
}
fn change_distribution ( percent_pop : usize , canvas : & mut WindowCanvas ) -> RandomCells { let title = format ! ( " " GRID_SIZE GRID_SIZE percent_pop ) ; canvas . window_mut ( ) . set_title ( & title ) . unwrap ( ) ; let limit = ( GRID_SIZE * GRID_SIZE ) * percent_pop / 100 ; RandomCells :: new ( limit , GRID_SIZE * GRID_SIZE ) }
change the distribution of alive and dead cells
change the distribution of alive and dead cells
percent_pop
usize
canvas
&mut WindowCanvas