Documentation
¶
Index ¶
- func BoolToInt(b bool) int
- func MaxInt(a, b int) int
- func MinInt(a, b int) int
- func ParseIntList(line string, sep string) ([]int, error)
- func ReadFileAsByteChunks(fileName string) [][]byte
- func ReadFileAsBytes(fileName string) []byte
- func ReadFileAsLines(fileName string) []string
- func ReadFileAsRuneMatrix(fileName string) [][]rune
- func SliceContainsRune(s []rune, r rune) bool
- func SliceContainsString(s []string, str string) bool
- func SlicePop[T any](s *[]T) (T, error)
- func StringToInt(line string) (int, error)
- func StringToIntArray(line string) ([]int, error)
- type Segment
- type SegmentList
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadFileAsByteChunks ¶
ReadFileAsByteChunks reads a file and returns a slice of byte slices
func ReadFileAsBytes ¶
ReadFileAsBytes reads a file and returns a slice of bytes
func ReadFileAsLines ¶
ReadFileAsLines reads a file line by line and returns a slice of strings
func ReadFileAsRuneMatrix ¶
ReadFileAsRuneMatrix reads a file and returns a matrix of strings Returns as [x][y] where x is the column (horizontal) and y is the row (vertical)
func SliceContainsRune ¶
SliceContainsRune returns true if a rune is in a slice of runes
func SliceContainsString ¶
SliceContainsString returns true if a string is in a slice of strings
func StringToInt ¶
StringToInt converts a string to an int wrapper for strconv.Atoi for standardization / readability
func StringToIntArray ¶
StringToIntArray converts a string to an array of ints wrapper for strconv.Atoi for standardization / readability
Types ¶
type SegmentList ¶
type SegmentList []Segment
func (*SegmentList) Lowest ¶
func (segList *SegmentList) Lowest() int
func (*SegmentList) Merge ¶
func (segList *SegmentList) Merge()
func (*SegmentList) Sort ¶
func (segList *SegmentList) Sort()
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
Stack is a generic stack implementation
func (*Stack[T]) GetStackString ¶
GetStack returns the stack as a string