Documentation ¶
Index ¶
- Variables
- func Abs[T AoCSigned](x T) T
- func Abs64(a int64) int64
- func AlphaNum(ch byte) int
- func BinToInt(s string) int
- func Blue(s string) string
- func Bold(s string) string
- func CRT(a, n []*big.Int) (*big.Int, error)
- func ChineseRemainderTheorem[T AoCInt](an [][2]T) *T
- func ChompInt[T AoCSigned](in []byte, i int) (int, T)
- func ChompOneOrTwoCharUInt[T AoCInt](in []byte, i int) (int, T)
- func ChompToNextLine(in []byte, i int) int
- func ChompUInt[T AoCInt](in []byte, i int) (j int, n T)
- func ClearScreen() string
- func CursorTo(x int, y int) string
- func Cyan(s string) string
- func DEBUG() bool
- func EGCD[T AoCInt](a, b T, x, y *T) T
- func FP2UKeyMax(bits int) int
- func FP3UKeyMax(bits int, zbits int) int
- func FastBytes(l []byte) []byte
- func FastInt64s(l []byte, expected int) []int64
- func FastInts(l []byte, expected int) []int
- func FastSignedInts(l []byte, expected int) []int
- func GCD(a, b int64) int64
- func Green(s string) string
- func InputBytes(embedded []byte) []byte
- func InputChunks(embedded []byte) []string
- func InputFile() string
- func InputInts(embedded []byte) []int
- func InputLines(embedded []byte) []string
- func InputString(embedded []byte) string
- func IntListContains(l []int, e int) bool
- func IntToBin(n int) string
- func Ints(l string) []int
- func LCM(a, b int64, integers ...int64) int64
- func Magenta(s string) string
- func Max[T AoCInt](a ...T) T
- func MaxInt(a ...int) int
- func MaxInt64(a ...int64) int64
- func MedianOfMedians(inp []int, n int) int
- func Min[T AoCInt](a ...T) T
- func MinInt(a ...int) int
- func MinInt64(a ...int64) int64
- func Mod[T AoCSigned](n, m T) T
- func ModExp(b, e, m uint) uint
- func MustParseInt(s string) int
- func MustParseInt64(s string) int64
- func MustParseUint(s string) uint
- func MustParseUint64(s string) uint64
- func NeverToBigMod[T AoCSigned](n, m T) T
- func NumAlpha(c int) byte
- func NumString(n int) string
- func NumberString(s string) string
- func NumberStrings(s string) []string
- func Permutations(min, max int) [][]int
- func Product[T AoCInt](ints ...T) T
- func Product64(ints ...int64) int64
- func ReadChunks(file string) []string
- func ReadFileBytes(file string) []byte
- func ReadFileChunks(file string) []string
- func ReadFileIntLines(file string) [][]int
- func ReadFileInts(file string) []int
- func ReadFileLines(file string) []string
- func ReadInputBytes() []byte
- func ReadInputChunks() []string
- func ReadInputIntLines() [][]int
- func ReadInputInts() []int
- func ReadInputLines() []string
- func ReadInt64s(lines []string) ([]int64, error)
- func ReadInts(in []string) []int
- func ReadIntsFromFile(file string) []int
- func ReadLines(file string) []string
- func Red(s string) string
- func ReverseIntList(lines []int) []int
- func ReverseString(s string) (r string)
- func ReverseStringList(lines []string) []string
- func RotateStrings(lines []string) []string
- func ScanInt(in []byte, i int) (int, int)
- func ScanUint(in []byte, i int) (int, int)
- func Screen() (int, int)
- func SimpleMedianN(inp []int, n int) int
- func SimpleReadInt64s(l string) []int64
- func SimpleReadInts(l string) []int
- func StringListContains(l []string, e string) bool
- func Sum[T AoCInt](ints ...T) T
- func Sum64(ints ...int64) int64
- func VISUAL() bool
- func Variations(k, n int) [][]int
- func VisitInts[T AoCSigned](in []byte, until byte, i *int, fn func(n T))
- func VisitSplit(in []byte, sep, until byte, i *int, fn func(s []byte))
- func VisitUints[T AoCInt](in []byte, until byte, i *int, fn func(n T))
- func VisitWords(in []byte, until byte, i *int, fn func(w []byte, term byte))
- func XSloppyReadInts(lines []string) []int
- func Yellow(s string) string
- type AlphaNumSet
- type AoCInt
- type AoCSigned
- type AoCUnsigned
- type BoundingBox
- type ByteCounter
- type ByteMap
- func (m *ByteMap) Add(i int, v byte)
- func (m *ByteMap) Contains(i int) bool
- func (m *ByteMap) Get(i int) byte
- func (m *ByteMap) GetXY(x, y int) byte
- func (m *ByteMap) Height() int
- func (m *ByteMap) IndexToString(i int) string
- func (m *ByteMap) IndexToXY(i int) (int, int)
- func (m *ByteMap) NeighbourValues(i int) []byte
- func (m *ByteMap) Neighbours(i int) []int
- func (m *ByteMap) Neighbours8(i int) []int
- func (m *ByteMap) Set(i int, v byte)
- func (m *ByteMap) SetXY(x, y int, v byte)
- func (m *ByteMap) Size() int
- func (m *ByteMap) String() string
- func (m *ByteMap) Visit(fn func(i int, v byte) (byte, bool))
- func (m *ByteMap) VisitNeighbours(i int, fn func(int, byte))
- func (m *ByteMap) VisitNeighboursXY(x, y int, fn func(int, int, byte))
- func (m *ByteMap) VisitXY(fn func(x, y int, v byte) (byte, bool))
- func (m *ByteMap) VisitXYI(fn func(x, y, i int, v byte) (byte, bool))
- func (m *ByteMap) Width() int
- func (m *ByteMap) XYToIndex(x, y int) int
- type CharCount
- type Circle
- type Combs
- type Compass
- type Deque
- type Direction
- type ElfProg2018
- type FBoundingBox
- type FP2
- func (p FP2) Add(o FP2) FP2
- func (p FP2) CCW() FP2
- func (p FP2) CW() FP2
- func (p FP2) ManhattanDistance(o FP2) int
- func (p FP2) Norm(o FP2) FP2
- func (p FP2) NormXY(o FP2) (int32, int32)
- func (p FP2) Rotate(rotation int) FP2
- func (p FP2) String() string
- func (p FP2) Sub(o FP2) FP2
- func (p FP2) UKey(bits int) uint64
- func (p FP2) XY() (int32, int32)
- type FP3
- func (p FP3) Add(o FP3) FP3
- func (p FP3) ManhattanDistance(o FP3) int
- func (p FP3) Norm(o FP3) FP3
- func (p FP3) ProjXY() FP3
- func (p FP3) Rotate(rotation int) FP3
- func (p FP3) String() string
- func (p FP3) Sub(o FP3) FP3
- func (p FP3) UKey(bits int, zbits int) uint64
- func (p FP3) XYZ() (int16, int16, int16)
- type HexPoint
- type IDBuilder
- type IDTracker
- type IDType
- type Inst
- type List2IDTracker
- type ListIDTracker
- type LowerAZID
- type MapByteCounter
- type NumStr
- type PerlyString
- type Perms
- type Point
- type Point3D
- type PointPair
- type Queue
- type SliceByteCounter
- func (bc *SliceByteCounter) Add(ch byte, c int)
- func (bc *SliceByteCounter) Bottom(n int) []byte
- func (bc *SliceByteCounter) Count(ch byte) int
- func (bc *SliceByteCounter) Inc(ch byte)
- func (bc *SliceByteCounter) Sort()
- func (bc *SliceByteCounter) String() string
- func (bc *SliceByteCounter) Top(n int) []byte
- type Subsets
- type UpperAZID
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ChineseRemainderTheorem ¶
func ChineseRemainderTheorem[T AoCInt](an [][2]T) *T
func ChompToNextLine ¶
func ClearScreen ¶
func ClearScreen() string
func FP2UKeyMax ¶
func FP3UKeyMax ¶
func FastInt64s ¶
func FastSignedInts ¶
func InputBytes ¶
func InputChunks ¶
func InputLines ¶
func InputString ¶
func IntListContains ¶
func MedianOfMedians ¶
func MustParseInt ¶
func MustParseInt64 ¶
func MustParseUint ¶
func MustParseUint64 ¶
func NeverToBigMod ¶
func NeverToBigMod[T AoCSigned](n, m T) T
func NumberString ¶
func NumberStrings ¶
func Permutations ¶
func ReadChunks ¶
func ReadFileBytes ¶
func ReadFileChunks ¶
func ReadFileIntLines ¶
func ReadFileInts ¶
func ReadFileLines ¶
func ReadInputBytes ¶
func ReadInputBytes() []byte
func ReadInputChunks ¶
func ReadInputChunks() []string
func ReadInputIntLines ¶
func ReadInputIntLines() [][]int
func ReadInputInts ¶
func ReadInputInts() []int
func ReadInputLines ¶
func ReadInputLines() []string
func ReadInt64s ¶
func ReadIntsFromFile ¶
ReadIntsFromFile slurps input from a file into a list of integers
func ReverseIntList ¶
func ReverseString ¶
func ReverseStringList ¶
func RotateStrings ¶
func SimpleMedianN ¶
func SimpleReadInt64s ¶
func SimpleReadInts ¶
func StringListContains ¶
func Variations ¶
func XSloppyReadInts ¶
Types ¶
type AlphaNumSet ¶
type AlphaNumSet uint64
func AlphaNumBit ¶
func AlphaNumBit(ch byte) AlphaNumSet
func NewAlphaNumSet ¶
func NewAlphaNumSet() AlphaNumSet
func (AlphaNumSet) Add ¶
func (s AlphaNumSet) Add(ch byte) AlphaNumSet
func (AlphaNumSet) Contains ¶
func (s AlphaNumSet) Contains(ch byte) bool
func (AlphaNumSet) Size ¶
func (s AlphaNumSet) Size() int
func (AlphaNumSet) String ¶
func (s AlphaNumSet) String() string
type AoCInt ¶
type AoCInt interface{ AoCUnsigned | AoCSigned }
type BoundingBox ¶
BoundingBox is a 2D bounding box representing by min and max points
func NewBoundingBox ¶
func NewBoundingBox() *BoundingBox
func (*BoundingBox) Add ¶
func (bb *BoundingBox) Add(p Point)
func (*BoundingBox) Contains ¶
func (bb *BoundingBox) Contains(p Point) bool
func (*BoundingBox) String ¶
func (bb *BoundingBox) String() string
type ByteCounter ¶
type ByteCounter interface { Inc(byte) Add(byte, int) Top(int) []byte Bottom(int) []byte Count(byte) int }
func NewMapByteCounter ¶
func NewMapByteCounter(n int) ByteCounter
func NewSliceByteCounter ¶
func NewSliceByteCounter(n int) ByteCounter
type ByteMap ¶
type ByteMap struct {
// contains filtered or unexported fields
}
func NewByteMap ¶
func (*ByteMap) IndexToString ¶
func (*ByteMap) NeighbourValues ¶
func (*ByteMap) Neighbours ¶
func (*ByteMap) Neighbours8 ¶
func (*ByteMap) VisitNeighboursXY ¶
type ElfProg2018 ¶
type ElfProg2018 struct { Prog []*Inst IP int Reg [6]int // contains filtered or unexported fields }
func NewElfProg2018 ¶
func NewElfProg2018(lines []string) *ElfProg2018
func (*ElfProg2018) Run ¶
func (g *ElfProg2018) Run(fn func(*ElfProg2018) bool) int
func (*ElfProg2018) String ¶
func (g *ElfProg2018) String() string
type FBoundingBox ¶
type FBoundingBox struct {
// contains filtered or unexported fields
}
func NewFBoundingBox ¶
func NewFBoundingBox() *FBoundingBox
func (*FBoundingBox) Add ¶
func (bb *FBoundingBox) Add(p FP2)
func (*FBoundingBox) AddXY ¶
func (bb *FBoundingBox) AddXY(x, y int32)
func (*FBoundingBox) String ¶
func (bb *FBoundingBox) String() string
func (*FBoundingBox) XLimits ¶
func (bb *FBoundingBox) XLimits() (int32, int32)
func (*FBoundingBox) YLimits ¶
func (bb *FBoundingBox) YLimits() (int32, int32)
type HexPoint ¶
type HexPoint struct {
// contains filtered or unexported fields
}
func NewHexPoint ¶
func (*HexPoint) Neighbours ¶
type IDBuilder ¶
type IDBuilder struct {
// contains filtered or unexported fields
}
func NewIDBuilder ¶
type List2IDTracker ¶
type List2IDTracker struct {
// contains filtered or unexported fields
}
func NewList2IDTracker ¶
func NewList2IDTracker(l int) *List2IDTracker
func (*List2IDTracker) Add ¶
func (t *List2IDTracker) Add(w []byte) int
func (*List2IDTracker) Len ¶
func (t *List2IDTracker) Len() int
func (*List2IDTracker) Pretty ¶
func (t *List2IDTracker) Pretty(i int) string
type ListIDTracker ¶
type ListIDTracker []int
func NewListIDTracker ¶
func NewListIDTracker(l int) ListIDTracker
func (*ListIDTracker) Add ¶
func (t *ListIDTracker) Add(w []byte) int
func (*ListIDTracker) Len ¶
func (t *ListIDTracker) Len() int
func (*ListIDTracker) Pretty ¶
func (t *ListIDTracker) Pretty(i int) string
type MapByteCounter ¶
type MapByteCounter struct {
// contains filtered or unexported fields
}
func (*MapByteCounter) Add ¶
func (bc *MapByteCounter) Add(ch byte, c int)
func (*MapByteCounter) Bottom ¶
func (bc *MapByteCounter) Bottom(n int) []byte
func (*MapByteCounter) Count ¶
func (bc *MapByteCounter) Count(ch byte) int
func (*MapByteCounter) Inc ¶
func (bc *MapByteCounter) Inc(ch byte)
func (*MapByteCounter) Top ¶
func (bc *MapByteCounter) Top(n int) []byte
type NumStr ¶
type NumStr struct {
// contains filtered or unexported fields
}
func NewNumStrFromBytes ¶
type PerlyString ¶
type PerlyString struct {
// contains filtered or unexported fields
}
func NewPerlyString ¶
func NewPerlyString(pw string) *PerlyString
func (*PerlyString) Bytes ¶
func (pw *PerlyString) Bytes() []byte
func (*PerlyString) Inc ¶
func (pw *PerlyString) Inc()
func (*PerlyString) String ¶
func (pw *PerlyString) String() string
type Point ¶
type Point struct {
X, Y int
}
Point is a two dimensional point defined by x and y coordinates
func (Point) ManhattanDistance ¶
ManhattanDistance returns the Manhattan distance between a 2d point and another 2d point
func (Point) Neighbours ¶
Neighbours returns the four neighbours of a point
func (Point) Neighbours8 ¶
Neighbours8 returns the eight neighbours of a point
type SliceByteCounter ¶
type SliceByteCounter struct {
// contains filtered or unexported fields
}
func (*SliceByteCounter) Add ¶
func (bc *SliceByteCounter) Add(ch byte, c int)
func (*SliceByteCounter) Bottom ¶
func (bc *SliceByteCounter) Bottom(n int) []byte
func (*SliceByteCounter) Count ¶
func (bc *SliceByteCounter) Count(ch byte) int
func (*SliceByteCounter) Inc ¶
func (bc *SliceByteCounter) Inc(ch byte)
func (*SliceByteCounter) Sort ¶
func (bc *SliceByteCounter) Sort()
func (*SliceByteCounter) String ¶
func (bc *SliceByteCounter) String() string
func (*SliceByteCounter) Top ¶
func (bc *SliceByteCounter) Top(n int) []byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.