Skip to main content

Command line implementation for game of life

Project description

GofL

Command line implementation for Conway's Game of Life

Rules for the Game of Life:

birth - empty cell with 3 neighbors
survival to the next step - 2 or 3 neighbors
death from overpopulation - more than 3 neighbors
death from loneliness - less than 2 neighbors

Install

pip install -r requirements.txt

How to run:

Run 20 by 20 field with 40% live cells for 3 iterations with in-line animation at 0.5 sec per frame.

python life.py -s 20 -d 40 -fd 0.5 -i 3

Help

python life.py -h
usage: life.py [-h] [-s SIZE] [-d CELL_DENSITY] [-na] [-fd FDELAY] [-i ITERS]
               [-rn RNSEED]

optional arguments:
  -h, --help            show this help message and exit
  -s SIZE, --size SIZE  size of square game field
  -d CELL_DENSITY, --cell_density CELL_DENSITY
                        percent of live cells at start
  -na, --noanimation    run without command line animation
  -fd FDELAY, --fdelay FDELAY
                        animation frame delay
  -i ITERS, --iters ITERS
                        number of game repeats
  -rn RNSEED, --rnseed RNSEED
                        select random seed to start

Limits for arguments

'size': (2, 51),
'cell_density': (10, 90),
'fdelay': (0.1, 1),
'iters': (1, 1001),
'rnseed':(0, 1000)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

game_of_life_gofl-0.0.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file game_of_life_gofl-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for game_of_life_gofl-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5be5a0c60a5dace5f57930c5eee3e4c73b1a9c9acee4302b0cf5bd3b8a693185
MD5 3fd9103169ab3eca29b56741b22167a7
BLAKE2b-256 efe640f89dcfcf69cab738017f615884501b552cb7c5ad7acae81289356553bb

See more details on using hashes here.

Supported by

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