Skip to content

A Game of Life emulation with support for Life 1.06, Life 1.05, RLE, and plaintext files.

License

Notifications You must be signed in to change notification settings

splintersuidman/game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life Build Status

A Game of Life emulation with support for several file formats.

Window Demo

File support

This program supports the following file formats:

You can find a lot of patterns, and their files, on the LifeWiki. There is a list of patterns here. To use a file, pass it to the --file flag (see below for more flags).

Installation

Install Rust. Then run the following in your terminal:

# Install from GitHub with cargo.
cargo install --git https://github.com/splintah/game-of-life

This will install game-of-life into $HOME/.cargo/bin/, which should be in your PATH variable when you have installed Rust via rustup.

Installation from source

Install Rust. Then run the following in your terminal:

# Clone the code.
git clone https://github.com/splintah/game-of-life.git
# Change your directory to `game-of-life`.
cd game-of-life
# Install the binaries.
cargo install

Usage

game-of-life 0.3.0
Splinter Suidman (splintah) & Sybrand Aarnoutse (syberant)
game-of-life emulates John Conway's game of life.
Press Escape to exit, press C to toggle cursor capture and press Space or a mouse button to reinitialise grid.
Pressing ctrl and scrolling will zoom in on the cells.
A file can be dropped on the screen to load that file. When the grid is reinitialised, it will be reinitialised with
that file.

USAGE:
    game-of-life [FLAGS] [OPTIONS]

FLAGS:
        --border     Display the border.
        --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --background <background>    Change the background colour.
                                     The colour should be passed as a hexidecimal RGB colour, example: FFFFFF for white,
                                     000000 for black.
                                     Default: FFFFFF.
    -c, --cell-width <cell-width>    Change width of a cell (in pixels).
                                     Default: 10.
    -l, --chance <chance>            Chance for randomly initialising board.
                                     Example: with '--chance 50' passed, cells will have a 50% chance of living.
                                     Default: 15.
    -f, --file <file>                The file that contains the board.
                                     If this flag is passed, the board will be initialised with the board in the given
                                     file.
                                     Default: None.
        --foreground <foreground>    Change the foreground colour of the cells.
                                     The colour should be passed as a hexidecimal RGB colour, example: FFFFFF for white,
                                     000000 for black.
                                     Default: 000000.
        --fps <fps>                  The amount of updates and frames that should be performed per second.
                                     This is the maximum frames per second; that is, the actual fps could be less.
                                     A frame rate of 0 fps will result in no fps limit.
                                     Default: 24.
    -h, --height <height>            Change the height of the board (in cells).
                                     Default: 50.
    -w, --width <width>              Change the width of the board (in cells).
                                     Default: 50.

About

A Game of Life emulation with support for Life 1.06, Life 1.05, RLE, and plaintext files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published