cellular

Crates.iocellular
lib.rscellular
version0.1.2
sourcesrc
created_at2021-06-27 01:48:02.826586
updated_at2021-06-27 02:21:26.12092
descriptionA simple command-line based cellular automaton animation creator
homepage
repositoryhttps://github.com/W-A-James/cellular
max_upload_size
id415319
size377,986
Warren James (W-A-James)

documentation

README

cellular

Rust

cellular is a command-line tool that allows for generation of gif images using elementary cellular automata. (Read more about elementary cellular automata here.) It supports starting automata with random seeds as well as providing initial inputs directly through the command line or from a file.

Installation

Via cargo

cargo install cellular

From source

Download the latest release tarball and execute the following:

tar -xvzf cellular-x.y.z.tar.gz .
cd cellular
cargo install --path .

Note that x.y.z is the version number of the tarball that you downloaded.

Usage

Run the following to see all available options and flags

cellular --help

Examples

Starting with a random initial bitmap

cellular --width 800 --height 600 --frames 100 --density 0.6 --rule 106 --output hello_cellular.gif

or

cellular -w 800 -h 600 -f 100 -d 0.6 -r 106 -o hello_cellular.gif

All options and their shortcut syntax are shown when the help flag is passed

→ cellular --help
cellular
A simple command-line based cellular automaton animation creator

USAGE:
    cellular [FLAGS] [OPTIONS] --frames <frames> --height <height> --width <width>

FLAGS:
        --help       Prints help information
    -n, --no-prog    disable progress bar
    -V, --version    Prints version information

OPTIONS:
    -b, --bitmap <bitmap>      Input bitmap as string of 1s and 0s
    -d, --density <density>    Probability that each cell in initialized bit vector will be occupied. Should be between
                               0.0 and 1.0 [default: 0.5]
    -f, --frames <frames>      Number of frames in final animation
    -h, --height <height>      Specifies height of output image
    -i, --infile <infile>      path to file containing initial bitmap as string of 1s and 0s
    -o, --output <output>      Specifies output file. Defaults to output_w<width>_h<height>_f<frames>_r<rule>.gif
    -r, --rule <rule>          8 bit unsigned integer which specifies the cellular automaton to simulate [default: 110]
    -w, --width <width>        Specifies width of output image

Starting with input provided as a command-line argument

echo "10010111000111" > file
cellular --bitmap 10010111000111 -h 600 -f 100 -d 0.6 -r 106 -o hello_cellular.gif

Starting with input provided from a file

echo "10010111000111" > file
cellular --infile file -h 600 -f 100 -d 0.6 -r 106 -o hello_cellular.gif

Example output

cellular -b 1100111101110100110100011011111110101111101110111001010110011010010001010011111011101110000011100100 -h 100 -f 200 -r 106

Rule 106 output

Commit count: 62

cargo fmt