GoLife

package module
v0.0.0-...-ab455e5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

GoLife

Documentation

Index

Constants

View Source
const (
	CHSIZE = 1000000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func NewCell

func NewCell(w *World, x, y int) Cell

func (*Cell) Age

func (c *Cell) Age() int

func (*Cell) Alive

func (c *Cell) Alive() bool

func (*Cell) Degrading

func (c *Cell) Degrading() bool

func (*Cell) Name

func (c *Cell) Name() string

func (*Cell) Neighbors

func (c *Cell) Neighbors() []*Cell

func (*Cell) SetName

func (c *Cell) SetName(name string)

func (*Cell) Step

func (c *Cell) Step() bool

func (*Cell) String

func (c *Cell) String() string

func (*Cell) ToDead

func (c *Cell) ToDead() bool

func (*Cell) ToLife

func (c *Cell) ToLife() bool

func (*Cell) X

func (c *Cell) X() int

func (*Cell) Y

func (c *Cell) Y() int

type World

type World struct {
	NotificationCh chan Cell
	// contains filtered or unexported fields
}

func NewWorld

func NewWorld(name string, xsize int, ysize int, agemax int, immmax int) *World

func (*World) Age

func (w *World) Age() int

func (*World) Cell

func (w *World) Cell(x int, y int) (*Cell, error)

func (*World) CreateWorld

func (w *World) CreateWorld()

func (*World) GetCell

func (w *World) GetCell(x int, y int) *Cell

func (*World) ImmunityRecovery

func (w *World) ImmunityRecovery()

func (*World) MaxImmunity

func (w *World) MaxImmunity() int

func (*World) NoImmunityRecovery

func (w *World) NoImmunityRecovery()

func (*World) Print

func (w *World) Print()

func (*World) Procreate

func (w *World) Procreate(p func() bool)

func (*World) Step

func (w *World) Step()

func (*World) ToDead

func (w *World) ToDead(x int, y int) bool

func (*World) ToLife

func (w *World) ToLife(x int, y int) bool

func (*World) X

func (w *World) X() int

func (*World) Y

func (w *World) Y() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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