Documentation ¶
Overview ¶
Package gencellular implements cellular automata (for now Conway's Game of Life).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalDefault ¶
EvalDefault is the default evaluation function used to evaluate the state of a cell in the next generation.
func SeedDefault ¶
SeedDefault is the default init function used to initialize the simulation.
Types ¶
type Animator ¶
type Animator struct { *Culture // contains filtered or unexported fields }
Animator is a cell culture that can be animated and exported to a GIF.
func NewAnimator ¶
NewAnimator returns a new cell culture animator with the given height and width.
func NewAnimatorCustom ¶
NewAnimatorCustom allows for a custom seed init and state eval function.
type Culture ¶
type Culture struct { Cells [2][][]bool // Cell buffers. Height int // Number of cells over x. Width int // Number of cells over y. Generation int // Number of ticks. Init SeedFunc // Function used to initialize the culture. Eval EvalFunc // Function used to evaluate the state of a cell in the next generation. }
Culture was a very smart way to call whatever holds the cells.
Click to show internal directories.
Click to hide internal directories.