gogol

package module
v0.0.0-...-053a264 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 0 Imported by: 0

README

This is a simple implementation of Conway's Game of Life in Golang which makes animated GIF files with 1 generation per frame.

Documentation

Overview

Package gogol is an implementation of Conway's Game of Life

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State is an instance of the Game of Life

func NewState

func NewState(width, height, neighbourRadius int) *State

NewState creates a new Game of Life State

func (*State) GetCell

func (state *State) GetCell(x, y int) bool

GetCell returns the state of the specified cell

func (*State) GetDimensions

func (state *State) GetDimensions() (int, int)

GetDimensions returns the dimensions of the world

func (*State) NextGeneration

func (state *State) NextGeneration()

NextGeneration calculates the next generation of the game

func (*State) SetCell

func (state *State) SetCell(x, y int, value bool)

SetCell sets the state of the specified cell

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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