gol

package
v0.0.0-...-4ede3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	W     int    `json:"w"`
	H     int    `json:"h"`
	Tiles []Tile `json:"tiles"`
}

drei nachbarn -> neu geboren in der nächsten phase weniger als zwei nachbarn -> einsam, stirbt in der nächsten phase mit zwei oder drei -> bleibt mit mehr als drei -> überbevölkert, stirbt in der nächsten phase

func NewMap

func NewMap(w, h int) *Map

func (*Map) Click

func (m *Map) Click(x, y int)

func (*Map) Neighbours

func (m *Map) Neighbours(x, y int) int

Neightbours return the count of neighboring tiles that are alive.

func (*Map) Step

func (m *Map) Step()

type Room

type Room struct {
	site.ChatRoom

	Map *Map
	// contains filtered or unexported fields
}

func NewRoom

func NewRoom(name string) *Room

func (*Room) Route

func (g *Room) Route(m *hub.Msg)

type Tile

type Tile int8
const (
	TileBirth Tile = -1
	TileNone  Tile = 0
	TileAlive Tile = 1
	TileDeath Tile = 2
)

func (Tile) Active

func (t Tile) Active() bool

func (*Tile) Toggle

func (t *Tile) Toggle()

Jump to

Keyboard shortcuts

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