pub fn create_rows(&mut self, dimensions: (usize, usize)) -> Vec<i32> {
        // empty array to destined length
        let size: usize = dimensions.0 * dimensions.1; 
        let mut nums: Vec<i32> = Vec::new();
        nums.resize(size, -1);

        // scoped previous number that saves the newest generated number 
        let mut prev_before = -1;

        for i in 0..size {
            let mut new_num: i32 = 0;
            let mut bot_num: i32 = -1; // by default -1

            // set bot_num once it respects the boundaries
            if i > COLS {
                bot_num = nums[i - COLS];
            }

            // if the right wall is hit (after i * 6) then be true
            if i % COLS + 1 != 0 {
                new_num = self.get_number(prev_before, bot_num);
            }
            else {
                new_num = self.get_number(-1, bot_num);
            }

            prev_before = new_num; 
            nums[i] = new_num;
        }
        
        nums
    }
// create rows defined by the size of the dimensions parameter,
// the generated vector will not have any numbers that match neighboring
// numbers
create rows defined by the size of the dimensions parameter,
the generated vector will not have any numbers that match neighboring
numbers
create rows defined by the size of the dimensions parameter the generated vector will not have any numbers that match neighboring numbers
pub fn create_rows(&mut self, dimensions: (usize, usize)) -> Vec<i32> {
        // empty array to destined length
        let size: usize = dimensions.0 * dimensions.1; 
        let mut nums: Vec<i32> = Vec::new();
        nums.resize(size, -1);
        // scoped previous number that saves the newest generated number 
        let mut prev_before = -1;
        for i in 0..size {
            let mut new_num: i32 = 0;
            let mut bot_num: i32 = -1; // by default -1
            // set bot_num once it respects the boundaries
            if i > COLS {
                bot_num = nums[i - COLS];
            }
            // if the right wall is hit (after i * 6) then be true
            if i % COLS + 1 != 0 {
                new_num = self.get_number(prev_before, bot_num);
            }
            else {
                new_num = self.get_number(-1, bot_num);
            }
            prev_before = new_num; 
            nums[i] = new_num;
        }
        nums
    }
pub fn create_rows ( & mut self , dimensions : ( usize , usize ) ) -> Vec < i32 > { // empty array to destined length let size : usize = dimensions . 0 * dimensions . 1 ; let mut nums : Vec < i32 > = Vec :: new ( ) ; nums . resize ( size , - 1 ) ; // scoped previous number that saves the newest generated number  let mut prev_before = - 1 ; for i in 0 .. size { let mut new_num : i32 = 0 ; let mut bot_num : i32 = - 1 ; // by default -1 // set bot_num once it respects the boundaries if i > COLS { bot_num = nums [ i - COLS ] ; } // if the right wall is hit (after i * 6) then be true if i % COLS + 1 != 0 { new_num = self . get_number ( prev_before , bot_num ) ; } else { new_num = self . get_number ( - 1 , bot_num ) ; } prev_before = new_num ; nums [ i ] = new_num ; } nums }
create rows defined by the size of the dimensions parameter,
the generated vector will not have any numbers that match neighboring
numbers
create rows defined by the size of the dimensions parameter the generated vector will not have any numbers that match neighboring numbers
&mut self
dimensions
(usize, usize)
&mut self
dimensions
(usize, usize)