Skip to content

HansenH/Game-of-Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life

John Conway's Game of Life (python tkinter)

"keyboard" is needed: https://github.com/boppreh/keyboard

pip install keyboard

image

Instruction

press space to start / pause

press 'r' when paused to randomly initialize the cells

press 'c' when paused to clear the table

click cells when paused to switch their living states

Global constants in gameoflife.py are configurable including:

  • TABLE_COLS = 40
  • TABLE_ROWS = 40
  • TIME_INTERVAL = 0.2
  • NO_BORDER = True # whether table edges are linked
  • WINDOW_WIDTH = 600 # UI window width
  • WINDOW_HEIGHT = 600 # UI window height
  • GRID_THICK = 2
  • GRID_COLOR = '#BBBBBB'
  • TABLE_COLOR = '#666666'
  • LIFE_COLOR = '#00FF00'
  • RANDOM_INIT_PROB = 0.25 # probability of life for randomly initialzing cells
  • WINDOW_ADAPT = True

About

John Conway's Game of Life

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published