day455

package
v0.0.0-...-36687a4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coord

type Coord struct {
	X, Y int64
}

Coord represents a coordinate in the game of life.

type GameOfLife

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

GameOfLife represents the game state. '*' represents a live cell and '.' represents a dead cell.

func NewGameOfLife

func NewGameOfLife(board string) *GameOfLife

NewGameOfLife parses a starting board. The given board's lower left coordinate with be 0,0

func (*GameOfLife) Step

func (gol *GameOfLife) Step()

Step executes a single step of the simulation.

func (*GameOfLife) String

func (gol *GameOfLife) String() string

String returns the string representation of the board now.

Jump to

Keyboard shortcuts

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