Skip to content

mohamedsayed18/Conway_GOL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conway_GOL

Conway’s Game of Life

Project using python tkinter and numpy the main module conway contain two classes
ConWay: which handles calculations
GolGui: which handles GUI

How to use it

import the module and the tkinter

import tkinter as tk
from conway import ConWay, GolGui

make instances

play = ConWay()  # create a game instance
root = tk.Tk()  # create the master window
gou = GolGui(root)  # instance of my GUI

choose initial shapes to display

play.shapes('Beehive')  # choose the shape to start with
play.shapes('Toad')

then run the main_iteration function in (trial.py)

make_iteration()
root.mainloop()

in trial.py you can find example how to use this module

Important methods:

  • ConWay.shape(shape)
    take the shape you want to display Blinker, Toad, Glider or Beehive

  • ConWay.new_screen()
    Update the playground

  • GolGui.draw(playground)
    Draw the given numpy array

Contribution & future work

any one is welcomed to work on this code you work on any new feature or improve existing ones.
Some ideas:

  • Make the user choose the initial positions by mouse

About

Conway’s Game of Life

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages