PySimpleGUI/docs/eCookbook/conways-game-of-life.md

14 lines
879 B
Markdown
Raw Normal View History

2022-06-30 19:30:25 +00:00
**Conway's Game Of Life**
This demo is an adaptation of a text based Game of Life. The PySimpleGUI code was added to an existing engine. The GUI code is pretty well isolated, especially the board creation / setup code which is in a couple of class methods.
It demonstrates utilizing a `Graph` element to draw rectanges based on user mouse clicks. This kind of interface works well on both a traditional window + mouse setup or on a tablet's touchscreen.
This same code can be run on Android for example using PyDroid3.
The "Published" version of this code can be found here:
https://pysimplegui.trinket.io/sites/conways-game-of-life
It's the same output but done in a full-window, without the code being shown.
<iframe src="https://trinket.io/embed/pygame/447e96f4d4" width="100%" height="600" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>