Documentation ¶
Index ¶
- func Abs(x int) int
- func ByteToInt(b byte) (int, error)
- func DigitToRune(d int) rune
- func FirstRune(text string) rune
- func InsertAt[T any](data []T, index int, value T) []T
- func InsertSorted[S ~[]E, E constraints.Ordered](data S, value E) S
- func InsertSortedF[T any](data []T, value T, less func(left, right T) bool) []T
- func IsWhitespace(s string) bool
- func Max[T constraints.Ordered](x T, y T) T
- func MaxSlice[T constraints.Ordered](data []T) T
- func Min[T constraints.Ordered](x T, y T) T
- func MinSlice[T constraints.Ordered](data []T) T
- func MustReadLines(f embed.FS, name string) []string
- func ParseCommaSepInt(line string) ([]int, error)
- func ParseLines[T any](lines []string, parse func(string) (T, error)) ([]T, error)
- func Project[T any, U any](data []T, project func(T) U) []U
- func ReadAndParseLines[T any](f embed.FS, name string, parse func(string) (T, error)) ([]T, error)
- func ReadAsSingleLine(f embed.FS, name string) (string, error)
- func ReadLines(f embed.FS, name string) ([]string, error)
- func ReadLinesAsInt(f embed.FS, name string) ([]int, error)
- func Require(cond bool)
- func ReverseSlice[T any](slice []T)
- func RuneToInt(r rune) (int, error)
- func SetAll[T any](values []T, value T)
- func SplitOnWhiteSpace(line string) []string
- func StartsWithRune(s string, r rune) bool
- func StartsWithString(s, prefix string) bool
- func StringToInt(s string) int
- type Grid
- func (g *Grid[T]) Columns() int
- func (g *Grid[T]) Count() int
- func (g *Grid[T]) Index(row, column int) int
- func (g *Grid[T]) Resize(row, column int)
- func (g *Grid[T]) RowColumn(index int) (row, column int)
- func (g *Grid[T]) Rows() int
- func (g *Grid[T]) SetAll(value T)
- func (g *Grid[T]) SetValue(row, column int, value T)
- func (g *Grid[T]) Value(row, column int) T
- type Queue
- type Stack
- type VirtualGrid
- func (grid *VirtualGrid[T]) Columns() int
- func (grid *VirtualGrid[T]) MaxColumn() int
- func (grid *VirtualGrid[T]) MaxRow() int
- func (grid *VirtualGrid[T]) MinColumn() int
- func (grid *VirtualGrid[T]) MinRow() int
- func (grid *VirtualGrid[T]) Rows() int
- func (grid *VirtualGrid[T]) SetValue(row, column int, value T)
- func (grid *VirtualGrid[T]) Value(row, column int) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DigitToRune ¶
func InsertSorted ¶
func InsertSorted[S ~[]E, E constraints.Ordered](data S, value E) S
func InsertSortedF ¶
func IsWhitespace ¶
func Max ¶
func Max[T constraints.Ordered](x T, y T) T
func MaxSlice ¶
func MaxSlice[T constraints.Ordered](data []T) T
func Min ¶
func Min[T constraints.Ordered](x T, y T) T
func MinSlice ¶
func MinSlice[T constraints.Ordered](data []T) T
func ParseCommaSepInt ¶
func ParseLines ¶
func ReadAndParseLines ¶
func ReverseSlice ¶
func ReverseSlice[T any](slice []T)
func SplitOnWhiteSpace ¶
func StartsWithRune ¶
func StartsWithString ¶
func StringToInt ¶
Types ¶
type Grid ¶
type Grid[T any] struct { // contains filtered or unexported fields }
type VirtualGrid ¶
type VirtualGrid[T any] struct { // contains filtered or unexported fields }
func NewVirtualGrid ¶
func NewVirtualGrid[T any]() *VirtualGrid[T]
func NewVirtualGridWithDefaultValue ¶
func NewVirtualGridWithDefaultValue[T any](value T) *VirtualGrid[T]
func (*VirtualGrid[T]) Columns ¶
func (grid *VirtualGrid[T]) Columns() int
func (*VirtualGrid[T]) MaxColumn ¶
func (grid *VirtualGrid[T]) MaxColumn() int
func (*VirtualGrid[T]) MaxRow ¶
func (grid *VirtualGrid[T]) MaxRow() int
func (*VirtualGrid[T]) MinColumn ¶
func (grid *VirtualGrid[T]) MinColumn() int
func (*VirtualGrid[T]) MinRow ¶
func (grid *VirtualGrid[T]) MinRow() int
func (*VirtualGrid[T]) Rows ¶
func (grid *VirtualGrid[T]) Rows() int
func (*VirtualGrid[T]) SetValue ¶
func (grid *VirtualGrid[T]) SetValue(row, column int, value T)
func (*VirtualGrid[T]) Value ¶
func (grid *VirtualGrid[T]) Value(row, column int) T
Click to show internal directories.
Click to hide internal directories.