Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(i int) int
- func Check(err error)
- func GCD(a, b int) int
- func GetAllPermutations(s string) []string
- func HexaDist(x, y int) int
- func LCM(a, b int) int
- func Max(values ...int) int
- func Min(values ...int) int
- func Multiply(values ...int) int
- func MustAtoi(s string) int
- func MustScanf(line, format string, a ...interface{})
- func ParseIntList(s, sep string) []int
- func ParseIntMap(s, sep string) map[int]int
- func Perm(a []rune, f func([]rune))
- func RecursiveSum(i int, sumFunc SumFunc) int
- func Sum(values ...int) int
- type HexaP
- func (p *HexaP) DistFrom(from *HexaP) int
- func (p *HexaP) DistFromOrigin() int
- func (p *HexaP) Move(steps int)
- func (p *HexaP) MoveNorth(steps int)
- func (p *HexaP) MoveNorthEast(steps int)
- func (p *HexaP) MoveNorthWest(steps int)
- func (p *HexaP) MoveSouth(steps int)
- func (p *HexaP) MoveSouthEast(steps int)
- func (p *HexaP) MoveSouthWest(steps int)
- func (p *HexaP) TurnLeft()
- func (p *HexaP) TurnRight()
- type P
- func (p *P) DistFrom(from *P) int
- func (p *P) DistFromOrigin() int
- func (p *P) FindInMap(stringMap [][]string, origin P) string
- func (p *P) FourWays() []P
- func (p *P) Move(steps int)
- func (p *P) MoveDown(steps int)
- func (p *P) MoveLeft(steps int)
- func (p *P) MoveRight(steps int)
- func (p *P) MoveUp(steps int)
- func (p P) String() string
- func (p *P) TurnLeft()
- func (p *P) TurnRight()
- type SumFunc
- type Tile
Constants ¶
View Source
const ( HEXASOUTH = iota HEXASOUTHEAST HEXANORTHEAST HEXANORTH HEXANORTHWEST HEXASOUTHWEST )
View Source
const ( UP = iota LEFT DOWN RIGHT )
Variables ¶
View Source
var DirectionMap = map[int]struct { x, y int name string }{ UP: {0, 1, "up"}, LEFT: {1, 0, "left"}, DOWN: {0, -1, "down"}, RIGHT: {-1, 0, "right"}, }
View Source
var HexaDirectionMap = map[int]struct { x, y int name string }{ HEXASOUTH: {1, 0, "SOUTH"}, HEXASOUTHEAST: {1, -1, "SOUTHEAST"}, HEXANORTHEAST: {0, -1, "NORTHEAST"}, HEXANORTH: {-1, 0, "NORTH"}, HEXANORTHWEST: {-1, 1, "NORTHWEST"}, HEXASOUTHWEST: {0, 1, "SOUTHWEST"}, }
Functions ¶
func GetAllPermutations ¶
func ParseIntList ¶
func ParseIntMap ¶
func RecursiveSum ¶
Types ¶
type HexaP ¶
func NewHexaPoint ¶
func NewHexaPoint() *HexaP
func (*HexaP) DistFromOrigin ¶
func (*HexaP) MoveNorthEast ¶
func (*HexaP) MoveNorthWest ¶
func (*HexaP) MoveSouthEast ¶
func (*HexaP) MoveSouthWest ¶
type P ¶
func (*P) DistFromOrigin ¶
type Tile ¶
func (*Tile) PathEstimatedCost ¶
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance
func (*Tile) PathNeighborCost ¶
PathNeighborCost returns the cost of the tube leading to Truck.
func (*Tile) PathNeighbors ¶
func (t *Tile) PathNeighbors() []astar.Pather
func (*Tile) SetEmptyTiles ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.