Documentation
¶
Index ¶
- func Abs(i int) int
- func Atoi(s string) int
- func Factors(n int) []int
- func Gcd(a, b int) int
- func Lcm(a, b int, integers ...int) int
- func Max(in ...int) int
- func Min(in ...int) int
- func Mod(a, b int) int
- func Permutations(in []int) <-chan []int
- func Product(i ...int) int
- func Sqrt(i int) int
- func Sum(i ...int) (ret int)
- type Bitmap
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gcd ¶
Gcd returns the greatest common denominator of two numbers. https://play.golang.org/p/SmzvkDjYlb
func Permutations ¶
Permutations returns all of the permutations of a given slice of ints.
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
Bitmap provides a simple implementation of a 64 bit bitmap
func (Bitmap) AndEq ¶
AndEq bitwise ANDs the values and returns true if the result matches the called Bitmap.
type Point ¶
type Point struct {
X, Y int
}
Point is a point in Cartesian space.
func (Point) AllNeighbors ¶
AllNeighbors returns the neighboring points in all directions. This function returns points in reading order.
func (Point) ContainedIn ¶
ContainedIn determines if this point is within a rectangle described by two points.
func (Point) ManhattanDistanceTo ¶
ManhattanDistanceTo computes the distance between two points on a grid.
Click to show internal directories.
Click to hide internal directories.