Skip to content

dkostmii/ca-1d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ca-1d

Elementary cellular automata CLI, written in C.

Update

I've decided to cut down functionality to just printing cellular automata state in 0's and 1's.

Usage

Usage:
	build/release/ca-1d --help
	build/release/ca-1d --rule=[0-255] --width=[1-1000] --height=[1-1000]

Example

echo "00100" | build/release/ca-1d --rule=60 --width=10 --height=inf | head -n 4

Result:

0010000000
0011000000
0010100000
0011110000

STDIN is not required.

Example usage is showed in animated Python script:

Python animation example

Installing

This installs binary to system:

sudo make clean install

Now, you can run:

ca-1d ...your options

To uninstall run:

sudo make uninstall

Building

This builds in release mode:

make clean && make

Then run:

./build/release/ca-1d ...your options

To build in debug mode:

make clean && make debug

Then debug, using GDB:

gdb --args ./build/debug/ca-1d ...your options

Development

If encounter bugs or want to improve the project, feel free to post an issue or submit PR 😎