Any Cellular Automaton rule fed as input to Conway's Game of Life. This project is inspired by this amazing video by Elliot Waite.
This version of the program is not limited to rule 30, and can generate any of the 256 rules possible from elementary cellular automata.
Make sure you have Go installed on your system
go run *.go
This should take some time as go collects the various files used by sdl
, which is the rendering engine used in the program.
You can tweak the following output parameters. These can be found at the top of the main.go
file.
cellSize
: The sidelength in pixels of the cells of the output grid.cellCountX
: The width of the output grid in cellscellCountY
: The height of the output grid in cellsdivisionY
: The layer at which the board rules change from Elementary Cellular Automata to Conway's Game of LifeframeSleepTime
: How long the program should halt between each frame. Allows to speed up or slow down the outputrule
: The Elementary Cellular Automaton rule number to generate at the bottom of the grid
Note that you'll have to restart the program everytime you want these changes to take effect.
The colors can also be changed, the list can be found at the top of the main
function in main.go
func main() {
p := []color{
0xffffff01, // first color is a live cell
0x711C9108, // ...everything here is dead
0xea00d91b, // and solely for aesthetic
0x0adbc640, // purposes.
0x133ea47d,
0x00000001, // last color is black with step=1
}
// ...
}
Each color is specified as a hex value. The given channels are RGBA
.