coord

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2018 License: GPL-3.0 Imports: 1 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 {
	// contains filtered or unexported fields
}

Coord represents a cell in a grid.

func New

func New(x, y int) *Coord

New creates a new coord, representing a cell in a grid in the given position. Positions are represented as cartesian coordinates.

func NewRandom

func NewRandom(w, h int) *Coord

NewRandom creates a new coord in a random position inside a grid of the given dimensions.

func (*Coord) X

func (c *Coord) X() int

X returns the cell's abscissa. Implements conway.Coord.

func (*Coord) Y

func (c *Coord) Y() int

Y returns the cell's ordinate. Implements conway.Coord.

Jump to

Keyboard shortcuts

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