One-Dimensional Cellular Automaton

For this post I will write a simple implementation of a 1-dimensional cellular automaton in C. The concept of cellular automata has existed since the middle of the 20th century and has grown into a vast field with many practical and theoretical applications.

A cellular automaton consists of any number of "cells" arranged in 1, 2, 3 or more dimensions. Each has a state associated with it (in the simplest case just on or off) and each cell and therefore the entire automaton transitions from one state to the next over time according to a rule or set of rules.

The number of dimensions, the number of possible cell states, and the rules can become arbitrarily large and complex but for this project I will implement the simplest type of one-dimensional cellular automaton, known as an elementary cellular automaton.

Continue reading

An Introduction to Ncurses

My previous post was on the Galton Board which required the ability to print at a specified location in a specified colour within the terminal. Both these can be done without any additional libraries which is what I did for the first version of the Galton Board. However, a better solution is to use the Ncurses Posix library which provides the necessary functionality and much more.

Continue reading