Documentation ¶
Index ¶
- func Abs(x int64) int64
- func Atoi(str string) int
- func GCD(x, y int64) int64
- func IncDecCount(input []int) (incCount, decCount int)
- func InputToLines(file string) (lines []string)
- func IntSlidingWindowSum(input []int, window int) (sums []int)
- func LCM(a, b int64, integers ...int64) int64
- func LinesToFloats(file *os.File) (floats []float64, err error)
- func LinesToInts(file *os.File) (ints []int, err error)
- func LinesToStrings(file *os.File) (strings []string)
- func Max(m map[string]int) (ind string)
- func Min(m map[string]int) (ind string)
- func MinInt(m []int) (min int)
- func OpenFile(f string) (file *os.File)
- func PrintImage(image [][]string)
- func RenderGrid(grid map[Point]int64) [][]string
- func ReverseSlice[S ~[]E, E any](s S)
- func RunProgram(prog []string, output chan<- int, halt, loop chan<- bool)
- func RunRobot(grid map[Point]int64, start Point, input <-chan int64, output chan<- int64)
- func SortSlice[T constraints.Ordered](s []T)
- func StreamLines(file string, output chan<- string)
- func StreamRunes(file string, output chan<- rune)
- func StreamStrings(file string, output chan<- string)
- func Sum[T Number](slice []T) (sum T)
- func SumOfFloat64Array(test []float64) (result float64)
- func SumOfIntArray(test []int) (result int)
- func ToggleInstruction(prog []string, ind int) []string
- type Graph
- type Node
- type Number
- type Point
- func (p *Point) Angle(t Point) (angle float64)
- func (p *Point) ManhattanDist(t Point) int64
- func (p *Point) Move(n [2]int64)
- func (p *Point) MoveDir(dir rune)
- func (p *Point) MoveDirN(dir rune, steps int64)
- func (p *Point) MoveRelative(n *Point)
- func (p *Point) MoveRelativeN(n *Point, times int64)
- func (p *Point) Rotate90(cc bool)
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncDecCount ¶
func InputToLines ¶
func IntSlidingWindowSum ¶
func LinesToStrings ¶
func PrintImage ¶
func PrintImage(image [][]string)
func RenderGrid ¶
func ReverseSlice ¶
func ReverseSlice[S ~[]E, E any](s S)
func RunProgram ¶
func SortSlice ¶
func SortSlice[T constraints.Ordered](s []T)
func StreamLines ¶
func StreamRunes ¶
func StreamStrings ¶
func SumOfFloat64Array ¶
SumOfFloat64Array sums all float64 in the array
func SumOfIntArray ¶
SumOfIntArray sums all int in the array
func ToggleInstruction ¶
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) AddChildToParent ¶
type Number ¶
type Number interface { constraints.Float | constraints.Integer }
Type constraint for general numbers
type Point ¶
type Point struct {
X, Y int64
}
func (*Point) ManhattanDist ¶
func (*Point) MoveRelative ¶
func (*Point) MoveRelativeN ¶
Click to show internal directories.
Click to hide internal directories.