Documentation
¶
Index ¶
- Variables
- type Grid
- func (g *Grid[T]) Clone() *Grid[T]
- func (g *Grid[T]) GetSliceInDirectionP(p aoc.Point, direction aoc.Point, count int) []T
- func (g *Grid[T]) GetSliceToEdge(x, y int64, movement aoc.Point) []T
- func (g *Grid[T]) GetState(x, y int64) T
- func (g *Grid[T]) GetStateP(p aoc.Point) T
- func (g *Grid[T]) IsValid(x, y int64) bool
- func (g *Grid[T]) IsValidPoint(p aoc.Point) bool
- func (g *Grid[T]) Neighbours(p aoc.Point) []aoc.Point
- func (g *Grid[T]) SetState(x, y int64, state T)
- func (g *Grid[T]) SetStateP(p aoc.Point, state T)
- func (g *Grid[T]) StateMap() map[aoc.Point]T
- func (g *Grid[T]) StateMapWhere(f func(T) bool) map[aoc.Point]T
- func (g *Grid[T]) StateString() string
- func (g *Grid[T]) StateStringInvertY() string
- func (g *Grid[T]) StatesWhere(f func(T) bool) []aoc.Point
- func (g *Grid[T]) XLen() int64
- func (g *Grid[T]) YLen() int64
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var Directions4 = []aoc.Point{
{X: 0, Y: 1},
{X: 1, Y: 0},
{X: 0, Y: -1},
{X: -1, Y: 0},
}
View Source
var Directions8 = []aoc.Point{
{X: 0, Y: 1},
{X: 1, Y: 1},
{X: 1, Y: 0},
{X: 1, Y: -1},
{X: 0, Y: -1},
{X: -1, Y: -1},
{X: -1, Y: 0},
{X: -1, Y: 1},
}
Functions ¶
This section is empty.
Types ¶
type Grid ¶
type Grid[T any] struct { // contains filtered or unexported fields }
func NewWithDefault ¶
func (*Grid[T]) GetSliceInDirectionP ¶
func (*Grid[T]) GetSliceToEdge ¶
func (*Grid[T]) StateString ¶
func (*Grid[T]) StateStringInvertY ¶
Click to show internal directories.
Click to hide internal directories.