Skip to content

rongrimes/conway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ron's Conway Game of Life

Conway grid
 

Absolutely the world needs another Conway Game of Life implementation. This version is:

  • more colourful
  • more exotic
  • more "yes, absolutely"
    ... than any other version ever written.

Purpose:

I wanted to learn basic tk (windows) progamming in Linux. I used a very simple learning package from:

Environment

The program was developed on a (usually) headless Raspberry Pi with MobaXterm software running on a Windows platform. I developed and ran the program in an ssh window, and MobaXterm acted as an X-Server to display the grid in Windows.

The "production environment" is a Raspberry Pi with a Touchscreen Display.


Features

Restart

This action discards the current cycle and starts a new cycle. Apart from just playing with it, the button is only needed on rare occasions.

The program checks back for the last 20 iterations to see if the current state has been previously shown. If so, the cycle will end (or end soon), and then restart. There is one pattern that takes over 40 iterations to repeat, and is not being trapped. If this situation occurs, then a Restart is necessary. The condition can be recognized when the Iterations count gets above more than 1000.

Single step mode

The cycle can be shown in single step mode. Touch the Single Step button, and then touch the button repeatedly to take it through its steps. Touch Continue to resume normal operation.

Status Display

Self explanatory for most values.
Max: Highest number of iterations for a cycle since the program began.


Config

Config window
The Width and Height of the display window are adjustable. This enables runtime sizing for the display (for me, the Raspberry Pi Touchscreen Display).

The Init. cell prob. (initial cell probability) controls the density of the grid at the begining of a cycle. Each cell has a probability (out of 10) of being initialized, with "1" being a low probability while 9 is "high". Heuristic analysis shows that an initial cell probability of 3 or 4 gives the longest run cycles.


Fixes

December 5, 2017
The Config window would appear multiple times if the config button was pressed repeatedly without closing the Config window.
Now the Config window will get focus and will not repeatedly instantiate if the config button is pressed without removing the previous window.
(Thanks Martin!)