Package: simple-game-of-life
Game Of LifeSimple way to play Conway's game of life in python.You can import your own map as json file name "save.json", usingget_MAPmethode.All you custom maps (in the save.json file) are available in the listcustom_maps.Other custom maps are available such as:my_map_1andmy_map_2, created usingMapclass :fromsimple_game_of_lifeimportMapm=Map(100)my_map_1=m.mini_random_MAP((25,20))my_map_2=m.kind(kind="line 10")NOTE : Two artificials borders are created for each map,The first one is visible while playing, it's in black.The second one is white (invisible) just after the black border, no cell can born hereInstallationRun the following command to install:$ pip install simple-game-of-lifeUsagefor a random mapfromsimple_game_of_lifeimportGameOfLifegame=GameOfLife(50)# 50 is the side (width, height) of the mapgame.start_animation()for a custom mapfromsimple_game_of_lifeimportGameOfLifefromrandomimportchoicemy_custom_map=GameOfLife.get_MAP()game=GameOfLife(custom_map=choice(my_custom_map))game.start_animation()# Note you can also import custom_map like that :# from simple_game_of_life import custom_mapto implement a pattern :fromsimple_game_of_lifeimportGameOfLife,Mapglider=[[0,1,0],[0,0,1],[1,1,1]]m=Map(100)# 100 is the side (width, height) of the mapmy_map=m.my_pattern(glider)game=GameOfLife(custom_map=my_map)game.start_animation()Other usageGameOfLifeclasse :You can save a map by usingsaved_MAPmethode.You can get a map by usingget_MAPmethode.You can reset all saved map by usingreset_MAPmethode.You can get all frames by usingget_historymethode.You can set a new animation with the same instance usingnew_animationmethode.Mapclasse :full_random_MAP: all the map gonna be random.mini_random_MAP: a portion of the map gonna be random.my_pattern: insert your pattern into an empty map.kind:insert well know pattern into an empty map, (currenly 5 patterns are available).random : choice randomly one of the following mapf"line {n}": vertical line, if n is given, n cell alive"glider""lwss": Lightweight spaceship"mwss": Middleweight spaceship"hwss": Heavyweight spaceshipYou can also calculate the average time of instancing, usingtimeitfunction:game=timeit(GameOfLife,loop=10,size_or_side=50,frames=200)# loop : number of loopgame.start_animation()Optionals parametersWhen instancingGameOfLifeclasse :Args:size_or_side ((iterable, lenght = 2) or int): 
  either size of a matrix  
  or side (width, height) of a square matrix. 
  Defaults to None.
  
  custom_map (iterable, matrix): 
  a custom map that you created using an iterable (dim=2, matrix), or by using `Board` classe . 
  Defaults to None.
  
  seed (int, optional): 
  set the seed, by using `np.random.seed`. 
  Defaults to None.
  
  frames (int, optional):
  number of frames calculated. 
  Defaults to 100.
  
  zoom (float, optional): 
  allow to create larger plot, if zoom=10 (square matrix) then the figure size will be (5, 5) inch. 
  Defaults to 10.when starting the animation usingstart_animation:NOTE :For saving, 
  You need first to install ffmpeg,
  First search : Homebrew website (https://brew.sh/),
  Copy past the command in a Terminal, press enter.
  Then in a Terminal : brew install ffmpegArgs:interval_between_two_frames (int, optional):
  Interval between two frames in milisecond. Defaults to 100.

  plot (bool, optional): 
  Allow plotting. Defaults to True.

  save (bool, optional):
  Allow save. Defaults to False.

  fps (int, optional):  
  Frames per second if saved. Defaults to 30.

  file_name (str, optional): 
  file name for saved, must end by ".mp4", ".mov", ".avi", ".flv" or ".wmv", otherwise it's save with ".mp4".
  Defaults to None.