Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidbuchanan314/pyswargol

A rather fast Game-of-Life implementation in pure Python (plus pysdl2)
https://github.com/davidbuchanan314/pyswargol

cgol game-of-life game-of-life-python multithreading pysdl2 python python3 sdl2 swar

Last synced: about 2 months ago
JSON representation

A rather fast Game-of-Life implementation in pure Python (plus pysdl2)

Awesome Lists containing this project

README

        

# pyswargol

```
$ python3 swargol.py --help
Usage: swargol.py [OPTIONS]

Render Conway's Game of Life via SDL2, unreasonably quickly.

Options:
--width=INT framebuffer width (default: 1280)
--height=INT framebuffer height (default: 720)
--vsync=BOOL enable vsync (default: True)
--fullscreen enable fullscreen
--drylife=BOOL use the non-standard "drylife" algorithm (default: True)
--slow use the very slow implementation (for benchmark comparisons)
--frameskip=INT only render 1-in-n frames to the screen (default: 1)
--num-procs=INT degree of parallelism (NB: number of actual threads will be 2n+1) (default: 8)
--bench-frames=INT render a certain number of frames and then exit (default: 0)

Other actions:
-h, --help Show the help
```

I've written [an article](https://www.da.vidbuchanan.co.uk/blog/python-swar.html) explaining more about how and why this code works.

![image](https://github.com/DavidBuchanan314/pyswargol/assets/13520633/217eaf38-d8b6-43ef-a37a-98a229dcae31)