Skip to content

Conway's Game of Life implementation in Python with an infinite field (online demo available thanks to pyxel)

License

Notifications You must be signed in to change notification settings

insolor/game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life

Tests Deploy Run in browser

Classic Conway's Game of Life

Plans

  • infinite field:
    • field is split into 32x32 (or 64x64) blocks, where each line in a block is an integer number, where each bit is a cell
    • the whole field is a dict where keys are block coordinates and values are blocks
      See models.py for inner implementation of the game field.
  • game loop
  • implement gui using pyxel
    • display field on the screen
      • draw visible part of the field
      • pan field view with the middle mouse button
      • change scale with the mouse wheel
    • controls (start/stop, step, clear buttons)
    • field editor
  • optimizations:
    • use parallelization (blocks can be processed independently, so it's possible to process subsets of blocks in different threads/processes)
    • rewrite parts in cython?

Online demo

https://insolor.github.io/game-of-life/

Running locally

Install dependencies

poetry install

Then run

poetry run app

Or

python -m game_of_life

from an activated venv.

Or

pyxel run main.py

Building to html

make all

About

Conway's Game of Life implementation in Python with an infinite field (online demo available thanks to pyxel)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published