Documentation ¶
Overview ¶
This package provides all means for creating the Conway's Game for arbitrary sizes and number of generations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGeneration ¶
func NewGeneration(rectangle image.Rectangle, palette color.Palette, ratio AspectRatio, model string, nbgeneration, nbgenerations int) *generation
return a new generation which is initially empty. Since this implementation honours colors, the contents are stored as indexes to a color palette and a colour model has to be given. The new generation is given index nbgeneration among nbgenerations
Types ¶
type AspectRatio ¶
type AspectRatio struct {
X, Y int
}
Frames can be generated with arbitrary aspect ratios, whose definition is given below. They represent a magnification of the underlying matrix by 1:X and 1:Y
type Conway ¶
type Conway struct {
// contains filtered or unexported fields
}
The Conway's Game consists of a slice with a number of generations each with a given width and height
func NewConway ¶
Return a new Conway's Game. Note that it is necessary to specify the first generation
func (*Conway) GetGIF ¶
return a gif animation of the Conway's Game with the given delay in 100th of a second between frames, and an initial delay equal to delay0 100th of a second. If average has a value strictly greater than 1 then the color index of each cell (either alive of dead) is averaged over the last "average" generations