Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type World ¶
type World [][]*Cell
World is a two-dimensional array of cells
func (World) Draw ¶
func (w World) Draw(s tcell.Screen)
Draw draws the state of the board to the screen.
func (World) Get ¶
Get returns the cell at its Row and Column.
Out-of-bounds coordinates are wrapped.
If the cell is dead, nil is returned.
func (World) Neighbors ¶
Neighbors counts the live cells in the Moore neighborhood of the specified coordinate. The average color of surrounding live cells is also computed.
If there are no live cells, tcell.ColorDefault is used as the average color.
func (World) Next ¶
Next computes the next generation according to the rules of the Game of Life according to John Conway
Click to show internal directories.
Click to hide internal directories.