Documentation
¶
Index ¶
- func CalculateScoreDown(h, r, c int, m [][]int) int
- func CalculateScoreLeft(h, r, c int, m [][]int) int
- func CalculateScoreRight(h, r, c int, m [][]int) int
- func CalculateScoreUp(h, r, c int, m [][]int) int
- func GetTreeMap(data []string) [][]int
- func GetVisibleTreesFromEast(tm [][]int) []int
- func GetVisibleTreesFromNorth(tm [][]int) []int
- func GetVisibleTreesFromSouth(tm [][]int) []int
- func GetVisibleTreesFromWest(tm [][]int) []int
- type Coordinate
- type Exercise
- type Tree
- type Visibility
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateScoreDown ¶
CalculateScoreDown calculates the score for the tree at the given location.
func CalculateScoreLeft ¶
CalculateScoreLeft calculates the score for the tree at the given location.
func CalculateScoreRight ¶
CalculateScoreRight calculates the score for the tree at the given location.
func CalculateScoreUp ¶
CalculateScoreUp calculates the score for the tree at the given location.
func GetTreeMap ¶
GetTreeMap takes the input data and creates a 2D array of trees.
func GetVisibleTreesFromEast ¶
GetVisibleTreesFromEast returns the visible trees from the east.
func GetVisibleTreesFromNorth ¶
GetVisibleTreesFromNorth returns the visible trees from the north.
func GetVisibleTreesFromSouth ¶
GetVisibleTreesFromSouth returns the visible trees from the south.
func GetVisibleTreesFromWest ¶
GetVisibleTreesFromWest returns the visible trees from the west.
Types ¶
type Coordinate ¶
Coordinate is a type that represents a coordinate.
type Exercise ¶
type Exercise struct {
common.BaseExercise
}
Exercise for Advent of Code 2022 day 8.
type Tree ¶
type Tree struct {
Name string
Location Coordinate
Height int
}
Tree is a type that represents a tree.
type Visibility ¶
type Visibility int
Visibility is a type that represents the visibility of a tree.
const ( Unknown Visibility = iota // default behavior of "Unknown" visibility is by design. Yes No )
Visibility is a type that represents the visibility of a tree.