Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = Config{ Cells: 50, Generations: 50, Format: "txt", Random: false, Rule: 30, Size: 5, }
Functions ¶
func Register ¶
func Register(key string, np NewPrinter)
Types ¶
type DrawPrinter ¶
type DrawPrinter struct { Drawer // contains filtered or unexported fields }
func (*DrawPrinter) Close ¶
func (d *DrawPrinter) Close() error
func (*DrawPrinter) Print ¶
func (d *DrawPrinter) Print(v []bool)
type Drawer ¶
The Drawer interface is an abstraction for drawing binary automata cells to an x/y grid.
type ImageDrawer ¶
An ImageDrawer is a drawer which draws to a grayscale gif.
func (*ImageDrawer) Close ¶
func (p *ImageDrawer) Close() error
func (*ImageDrawer) Draw ¶
func (p *ImageDrawer) Draw(x0, y0, x1, y1 int, b bool)
type JsonPrinter ¶
func (*JsonPrinter) Close ¶
func (p *JsonPrinter) Close() error
func (*JsonPrinter) Print ¶
func (p *JsonPrinter) Print(v []bool)
type NewPrinter ¶
TODO doc
type Printer ¶
A Printer prints automata generations.
func NewImagePrinter ¶
func NewImagePrinter(cells, generations, size int, out io.Writer, onClose func(*ImageDrawer) error) Printer
The newImagePrinter function returns a new image printer which writes to out.
func NewJsonPrinter ¶
Click to show internal directories.
Click to hide internal directories.