Skip to content

Terminal program to run and experiment with elementary cellular automata

Notifications You must be signed in to change notification settings

user-simon/eca-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elementary-Cellular-Automata Explorer

A command-line program for experimenting with elementary cellular automata. It takes as argument the Wolfram code (0-255) of the rule, and optionally an initial cell configuration (a sequence of ones and zeroes). By default, it runs until the entire terminal is filled with cells (in an alternate terminal screen), but you can also manually specify the number of generations to compute, and then add a delay between the generations to make it scroll.

A practical use case for this program has eluded researchers for years.

Usage

Build the binary using cargo build and invoke it according to the manual below. Optionally, you can also run it with cargo run -- [OPTIONS] <RULE> [INITIAL].

Usage: eca_explorer [OPTIONS] <RULE> [INITIAL]

Arguments:
  <RULE>
          The Wolfram code (0-255) of the rule

  [INITIAL]
          Initial cell configuration. If not specified, a random configuration with the same
          printed width as the terminal is used

Options:
  -e, --edges <EDGES>
          How the two edges are handled

          [default: wrap]

          Possible values:
          - copy: The previous edge values are retained
          - crop: Edge neighbours are set to `0`
          - wrap: Edge neighbours wrap around to the other side

  -g, --generations <GENERATIONS>
          Number of generations to run for. If not specified, the terminal height is used

  -d, --delay <DELAY>
          Number of milliseconds to delay before the next generation is computed

  -h, --help
          Print help (see a summary with '-h')

Examples

Rule 22 with a single toggled cell

$ eca_explorer 22 0000000000000000000000000001000000000000000000000000000

rule 22 demo

Rule 62 with a single toggled cell

$ eca_explorer 62 0000000000000000000000000001000000000000000000000000000

rule 62 demo

Rule 45 with randomized cells

$ eca_explorer 45

rule 45 demo

Rule 90 with randomized cells

$ eca_explorer 90

rule 90 demo

About

Terminal program to run and experiment with elementary cellular automata

Topics

Resources

Stars

Watchers

Forks

Languages