Documentation
¶
Index ¶
- func CreateSlice[T comparable](size int, initial T) []T
- func ElementHammingDistance[T comparable](s1 []T, s2 []T) int
- func ErrorCheck(e error)
- func IntsToStrings(intSlice []int) []string
- func OpenFile(path string) (*bufio.Scanner, *os.File)
- func StringsToInts(stringSlice []string) []int
- type Coordinates
- type Grid
- func (g *Grid[T]) AddColumn(index int, column []T) error
- func (g *Grid[T]) AddRow(index int, row []T) error
- func (g *Grid[T]) AppendColumn(column []T)
- func (g *Grid[T]) AppendRow(row []T)
- func (g *Grid[T]) ColContains(index int, item T) bool
- func (g *Grid[_]) ColSize() int
- func (g *Grid[T]) Contains(item T) bool
- func (g *Grid[T]) CoordInGrid(coord Coordinates) bool
- func (g *Grid[T]) Get(rowIndex int, columnIndex int) (T, error)
- func (g *Grid[T]) GetByCoord(coord Coordinates) (T, error)
- func (g *Grid[T]) GetColumn(index int) ([]T, error)
- func (g *Grid[T]) GetRow(index int) ([]T, error)
- func (g *Grid[_]) PrintGrid()
- func (g *Grid[T]) RowContains(index int, item T) bool
- func (g *Grid[_]) RowSize() int
- func (g *Grid[T]) Search(item T) []Coordinates
- func (g *Grid[_]) Serialize() string
- func (g *Grid[T]) Set(rowIndex int, columnIndex int, item T) error
- func (g *Grid[T]) SetByCoord(coord Coordinates, val T) error
- func (g *Grid[T]) SetColumn(index int, column []T) error
- func (g *Grid[T]) SetRow(index int, row []T) error
- func (g *Grid[_]) Shape() (int, int)
- type MaxPriorityQueue
- type MinPriorityQueue
- type PriorityElement
- type Set
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSlice ¶
func CreateSlice[T comparable](size int, initial T) []T
func ElementHammingDistance ¶
func ElementHammingDistance[T comparable](s1 []T, s2 []T) int
func ErrorCheck ¶
func ErrorCheck(e error)
func IntsToStrings ¶
func StringsToInts ¶
Types ¶
type Coordinates ¶
******************************************* // Coordinate structure and related functions. // ******************************************* //
func (Coordinates) Abs ¶
func (coord Coordinates) Abs() Coordinates
func (Coordinates) Add ¶
func (coord Coordinates) Add(otherCoord Coordinates) Coordinates
func (Coordinates) Scale ¶
func (coord Coordinates) Scale(scalar int) Coordinates
func (Coordinates) Subtract ¶
func (coord Coordinates) Subtract(otherCoord Coordinates) Coordinates
type Grid ¶
type Grid[T comparable] struct { Data [][]T }
************************************* // Grid structure and related functions. // ************************************* //
func GridFromFile ¶
func NewGrid ¶
func NewGrid[T comparable]() *Grid[T]
func (*Grid[T]) AppendColumn ¶
func (g *Grid[T]) AppendColumn(column []T)
func (*Grid[T]) ColContains ¶
func (*Grid[T]) CoordInGrid ¶
func (g *Grid[T]) CoordInGrid(coord Coordinates) bool
func (*Grid[T]) GetByCoord ¶
func (g *Grid[T]) GetByCoord(coord Coordinates) (T, error)
func (*Grid[T]) RowContains ¶
Column specific functions.
func (*Grid[T]) SetByCoord ¶
func (g *Grid[T]) SetByCoord(coord Coordinates, val T) error
type MaxPriorityQueue ¶
type MaxPriorityQueue[T comparable] struct { // contains filtered or unexported fields }
func (MaxPriorityQueue[_]) Less ¶
func (mpq MaxPriorityQueue[_]) Less(i, j int) bool
type MinPriorityQueue ¶
type MinPriorityQueue[T comparable] struct { // contains filtered or unexported fields }
func (MinPriorityQueue[_]) Less ¶
func (mpq MinPriorityQueue[_]) Less(i, j int) bool
type PriorityElement ¶
type PriorityElement[T comparable] struct { Value T Priority int }
type Set ¶
type Set[K comparable] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[K comparable]() *Set[K]
type Vector ¶
type Vector struct { Origin Coordinates Direction Coordinates }
**************************************** // Vector structure (origin and direction). // **************************************** //
Click to show internal directories.
Click to hide internal directories.