Documentation
¶
Index ¶
- Variables
- func AbsInt(a int) int
- func BinarySearch(min int, max int, worker func(i int) bool, debug bool) int
- func GreatestCommonDivisor(a int, n ...int) int
- func LeastCommonMultiple(a int, n ...int) int
- func MaxInt(a, b int) int
- func MaxIntArrayValue(arr []int) int
- func MinInt(a, b int) int
- func ParseInt(s string) int
- func ParseStringToIntArray(lines []string) []int
- func Permutations(arr []int) [][]int
- func PrintDayHeader(day int, title string)
- func PrintError(err error)
- func PrintSolution(result interface{})
- func PrintStepHeader(step int)
- func ReadFileAsIntArray(file string) []int
- func ReadFileToArray(path string) ([]string, error)
- func ReadFileToString(path string) (*string, error)
- type CalleeType
- type Direction
- type PQItem
- type PriorityQueue
- type RegistryType
Constants ¶
This section is empty.
Variables ¶
View Source
var AocYear = 2020
View Source
var Registry = newRegistry()
Functions ¶
func MaxIntArrayValue ¶
func ParseStringToIntArray ¶
func Permutations ¶
func PrintDayHeader ¶
noinspection GoUnhandledErrorResult
func ReadFileAsIntArray ¶
func ReadFileToArray ¶
* Read a file and returning the lines as array (without newlines)
func ReadFileToString ¶
* Read a file and returns its content as one string
Types ¶
type CalleeType ¶
type Direction ¶
type Direction string
const EAST Direction = "east"
const NORTH Direction = "north"
const SOUTH Direction = "south"
const WEST Direction = "west"
func NewDirection ¶
type PQItem ¶
type PQItem struct { Value interface{} Priority int // contains filtered or unexported fields }
type PriorityQueue ¶
type PriorityQueue []*PQItem
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type RegistryType ¶
type RegistryType struct {
// contains filtered or unexported fields
}
func (*RegistryType) Register ¶
func (r *RegistryType) Register(day int, callee CalleeType)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.