conways_gol/cells/living_cells_initialization.py
def random_init(self, random_init_length: int) -> np.ndarray:
        """
        Method that implements a random initialization for the Conway's
        Game-of-Life.

        :param random_init_length: length of the random initialization
        :return: grid with a random centered initialization
        """
        grid = self.universe
        init = []
        for i in range(random_init_length):
            random_list = []
            for j in range(random_init_length):
                n = random.randint(0, 1)
                random_list.append(n)
            init.append(random_list)
        grid[int((len(self.universe) - random_init_length) / 2):(
                len(self.universe) - int((len(self.universe) - random_init_length) / 2)),
        int((len(self.universe) - random_init_length) / 2):(
                len(self.universe) - int((len(self.universe) - random_init_length) / 2))] = init
        return grid

        Method that implements a random initialization for the Conway's
        Game-of-Life.

        :param random_init_length: length of the random initialization
        :return: grid with a random centered initialization
        
Method that implements a random initialization for the Conway's
Game-of-Life.
Method that implements a random initialization for the Conway ' s Game - of - Life .
def random_init(self, random_init_length: int) -> np.ndarray:
        grid = self.universe
        init = []
        for i in range(random_init_length):
            random_list = []
            for j in range(random_init_length):
                n = random.randint(0, 1)
                random_list.append(n)
            init.append(random_list)
        grid[int((len(self.universe) - random_init_length) / 2):(
                len(self.universe) - int((len(self.universe) - random_init_length) / 2)),
        int((len(self.universe) - random_init_length) / 2):(
                len(self.universe) - int((len(self.universe) - random_init_length) / 2))] = init
        return grid
def random_init ( self , random_init_length : int ) -> np . ndarray : grid = self . universe init = [ ] for i in range ( random_init_length ) : random_list = [ ] for j in range ( random_init_length ) : n = random . randint ( 0 , 1 ) random_list . append ( n ) init . append ( random_list ) grid [ int ( ( len ( self . universe ) - random_init_length ) / 2 ) : ( len ( self . universe ) - int ( ( len ( self . universe ) - random_init_length ) / 2 ) ) , int ( ( len ( self . universe ) - random_init_length ) / 2 ) : ( len ( self . universe ) - int ( ( len ( self . universe ) - random_init_length ) / 2 ) ) ] = init return grid
Method that implements a random initialization for the Conway's
Game-of-Life.
Method that implements a random initialization for the Conway ' s Game - of - Life .
"""
        Method that implements a random initialization for the Conway's
        Game-of-Life.

        :param random_init_length: length of the random initialization
        :return: grid with a random centered initialization
        """
grid with a random centered initialization
grid with a random centered initialization
self
random_init_length
int
length of the random initialization
length of the random initialization