life

package
v0.0.0-...-b914508 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2018 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Life

type Life struct {
	Generation int
	Width      int
	Height     int
	// contains filtered or unexported fields
}

Life contains all data about the current game

func New

func New(width, height int) *Life

New returns a new Life structure

func (*Life) Get

func (l *Life) Get() []uint8

Get returns a reference to the current buffer. Treat this as read-only!

func (*Life) Randomize

func (l *Life) Randomize()

Randomize fills the life grid randomly

func (*Life) Step

func (l *Life) Step()

Step runs a single generation

func (*Life) Steps

func (l *Life) Steps(n int)

Steps runs a number of steps

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL