Documentation ¶
Index ¶
- Variables
- func Draw(parts map[byte][]Vector, limit Vector) string
- func ManhattanMetric(v, u Vector) int
- type Direction
- type Metric
- type Vector
- func (v Vector) Add(u Vector) Vector
- func (v Vector) AddDirection(d Direction) Vector
- func (v Vector) Minus(u Vector) Vector
- func (v Vector) MinusDirection(d Direction) Vector
- func (v Vector) Neighbours() map[Direction]Vector
- func (v Vector) OrthogonalNeighbours() map[Direction]Vector
- func (v Vector) Within(limit Vector) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var DirectionToVector = map[Direction]Vector{ North: {0, -1}, NorthEast: {1, -1}, East: {1, 0}, SouthEast: {1, 1}, South: {0, 1}, SouthWest: {-1, 1}, West: {-1, 0}, NorthWest: {-1, -1}, }
7 0 1 6 2 5 4 3
Functions ¶
func ManhattanMetric ¶
Types ¶
type Vector ¶
type Vector struct {
X, Y int
}
func (Vector) AddDirection ¶
func (Vector) MinusDirection ¶
func (Vector) Neighbours ¶
func (Vector) OrthogonalNeighbours ¶
Click to show internal directories.
Click to hide internal directories.