text( 0.5, 0.965, " GAME OF LIFE ", transform =axes. transAxes, ha = " right ", va = " bottom ", color = " w ", fontsize = 25,įamily = " sans-serif ", fontweight = " light ")Īxes. scatter( *board, animated =True, s =marker_size, edgecolor =None)Īxes. A simulation is run, and based on some simple rules for life and death, cells continue to live, die off, or. The game starts with a population of cells placed in a certain pattern on the grid. The cells in the grid have a state of alive or dead. Status = get_init_status(size, initial_prob_life)įig, axes = plt. The Game of Life simulates life in a grid world (a two-dimensional block of cells). """ Implementation of Conway ' s Game of Life Parameters - size: tuple Defines the size of the board (n by m) initial_prob_life: float Float in the range (0, 1] defines the initial probability of a square containing life at initialisation animation_kwargs: dict Dictionary of keyword arguments to be passed to FuncAnimation marker_size: Size of scatter plot markers Returns - Instance of FuncAnimation """
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |