
 SDL LIFE1D. 1D Cellular Automata Graphics program for SDL2.
-------------------------------------------------------------
     (C) A.Millett 1992-2025.

 Released as free/open software under the terms of the GNU GPL3 license.  
 See:  www.gnu.org/licenses/gpl-3.0.html 

SDL LIFE is a one-dimensional cellular automata graphics generator program.
This is a well known (old school) effect, but even so you may find a 
few interesting ideas in this version.

QUICK START - Just run it, hit SPACE for each pattern.

DETAILS: For each seed a line of random pixels is generated across the display.
Then, each cell generated based on the 3 squares immediately above it,
adding them together to make an index for the "rules" array, which is
filled with random values (0 to NCOLOR-1) for the current seed. 
This val is plotted to the new square. These simple rules can generate 
some remarkable and beautiful chaotic graphical patterns...

Command keys:
 SPACE - Generate next seed. (or touch/click mouse on screen)
 D     - Reset defaults, go back to seed 1.
 N     - Change no of cell states/colours.
 M     - Change method of generation. (see below)
 J     - Change jump value. keeps same rules, different start pattern.
 X     - Step forward 10 seed val.
 C     - Step forward 100.
 U     - Step back (Undo) 1 seed value.
 T     - Step back 10.
 R     - Change Red colour offset/step.
 G     - Change Green colour offset/step.
 B     - Change Blue colour offset/step.    
 S     - Set Scale - no of screen-pixels per cell.
ESC    - Quit.

The "Method" parameter needs a bit more explaining.
The 5 bit value (1-31) chooses which of the 5 squares above the current
are added. So the default is 14 (=8+4+2), this is the 3 cells immediatly
above. If you use 31 (=1+2+4+8+16), all 5 above are added to make the 
current cell, and so on. Method 27 (=1+2+8+16) is an interesting one to try.
Changing the number of cell states/colours can result in interesting effects,
I have set 5 (ie, all cells are made with MODULUS 5) as the default.

This program needs SDL2, you may need to download this from the net.
The linux version is in the "sdl_life" folder, "sdl_life1d-linux32.elf".
The current version is only 10K in size.

It can compile/run on most modern computers/devices that support SDL2.
The source is included, "sdl_life1d.c". 
It is usable, but a "work in progress", ie No toolbar yet, etc.
To build the source, use the script file: ./sdlmak sdl_life1d -Os

Anyway, I hope you enjoy using this program.

