Skip to main content

Efficient Conway's Game of Life using NumPy

Project description

GoLPy

GitHub license PyPI Code style: black

GoLPy is an efficient Conway's Game of Life implemented in Python using NumPy.

Example Output

The following GIF can be generated using the command:

life --demo glidergun --out glider_gun.gif --ppc 10 --pos TL -W60 -H40

The Gosper Glider Gun

Installation

pip install golpy

Usage

usage: life [-h] (-i GRID_INPUT | -d DEMO) [-o FILE | --debug-print]
            [-W WIDTH] [-H HEIGHT] [-M MAX_GEN] [--ppc PIXELS] [-P POSITION]
            [-p]

optional arguments:
  -h, --help            show this help message and exit
  -i GRID_INPUT, --in GRID_INPUT
                        Parse the initial grid from <GRID_INPUT>
  -d DEMO, --demo DEMO  Try one of the provided demos: one of 'glidergun' and
                        'glidergen'
  -o FILE, --out FILE   Place the output into <FILE>
  --debug-print         Print the generated frames directly to the terminal,
                        instead of saving them

  -W WIDTH, --width WIDTH
                        Width of the grid
  -H HEIGHT, --height HEIGHT
                        Height of the grid

  -M MAX_GEN, --max-gen MAX_GEN
                        Number of generations to simulate
  --ppc PIXELS          Set the width and the height of each cell to <PIXELS>
  -P POSITION, --pos POSITION
                        One of 'C', 'T', 'B', 'L', 'R', 'TL', 'TR', 'BL', and
                        'BR'

  -p, --profile         Measure the performance

To use without installing,

python -m golpy # ...

Input Format

........................O
......................O.O
............OO......OO............OO
...........O...O....OO............OO
OO........O.....O...OO
OO........O...O.OO....O.O
..........O.....O.......O
...........O...O
............OO

Use . for a dead cell, O (chr(79)) for a live cell.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

golpy-0.3.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

golpy-0.3.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file golpy-0.3.0.tar.gz.

File metadata

  • Download URL: golpy-0.3.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.19 Darwin/23.4.0

File hashes

Hashes for golpy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 dc5ecef4f293f597801f08836a0c08380cf725c4aaac254286aca5e591111799
MD5 2689effff6ef6084a31e3e91d0a3944a
BLAKE2b-256 6d2fb11fecc81c2d510accd8031fe5e9ffeff04fcda9f27fe099b1368a89bf9c

See more details on using hashes here.

File details

Details for the file golpy-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: golpy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.19 Darwin/23.4.0

File hashes

Hashes for golpy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26ed4648356a87baafa11a6cdba7e528226f8b1f9337968bd7d5652a79436d78
MD5 1f5b2bc0d8ef8fce0007d07d3357e345
BLAKE2b-256 c153a70d29d911da5182430292e8c04d5a38612120a1e99c563446d07430ff98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page