Conway Game of Life

Conway's Game of Life

The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.[1] It is a zero-player game,[2][3] meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves. It is Turing complete and can simulate a universal constructor or any other Turing machine

source: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

video:
https://www.youtube.com/watch?v=C2vgICfQawE

https://www.youtube.com/watch?v=Kk2MH9O4pXY (Let’s BUILD a COMPUTER in CONWAY's GAME of LIFE)

This project implements Conway's Game of Life with a graphical user interface (GUI) for setting initial parameters and patterns. The game is built using pygame for visualization and tkinter for the configuration GUI.

video for the project:
https://www.youtube.com/watch?v=IbERCDOsiNM

Features

  • Configurable grid size and speed
  • Randomized initial grid or specific patterns
  • Adjustable colors for background and cells
  • Fullscreen or windowed mode
  • Multiple pre-defined initial patterns:
    • Blinker
    • Glider
    • Block
    • Toad
    • Beacon
    • Pulsar
    • Pentadecathlon
    • LWSS (Lightweight Spaceship)

Download

in Github python file: https://github.com/robopol/Conway-s-Game-of-Life
install .exe file:   https://www.poling.sk/python/setup_conway_game.exe

Usage

  1. Run the script: python conway_game.py

  2. Configure the game settings in the GUI:

    • Number of Rows: Set the number of rows in the grid.
    • Number of Columns: Set the number of columns in the grid.
    • Speed (FPS): Set the speed of the simulation in frames per second.
    • Randomize Grid: Choose whether to start with a random grid.
    • Fullscreen Mode: Choose whether to run the game in fullscreen mode.
    • Background Color: Select the background color.
    • Cell Color: Select the cell color.
    • Resolution: Set the screen resolution (e.g., 1920x1080).
    • Initial Pattern: Choose from a list of pre-defined patterns.
  3. Start the game by clicking the Start Game button.

Controls

  • Spacebar: Pause/Resume the game.
  • R: Reset the grid with a new random pattern.
  • C: Clear the grid.
  • Esc: Close the game window (returns to the GUI).

Patterns

The game includes several predefined patterns:

  • Blinker: A simple oscillator.
  • Glider: A small pattern that moves diagonally.
  • Block: A still life pattern.
  • Toad: A small oscillator.
  • Beacon: A larger oscillator.
  • Pulsar: A larger and more complex oscillator.
  • Pentadecathlon: An oscillator with a 15-generation period.
  • LWSS: A lightweight spaceship that moves across the grid.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

This project is licensed under the MIT License.