package
0.0.0-20241225053545-365cb6c4ab88
Repository: https://github.com/ghonzo/advent2024.git
Documentation: pkg.go.dev

# Functions

Abs returns the absolute value.
ArraysGridFromLines parses the lines and created a Grid with the y-dimension given by the number of lines and the x-dimension given by the length of the first line.
Atoi is just like the one in strconv, except we throw out the error.
Converts a string of ints separated by anything non-numeric into an int slice.
Count returns the number of instances of the given value in the grid.
greatest common divisor (GCD) via Euclidean algorithm.
find Least Common Multiple (LCM) via GCD.
MapGridValues applies a mapping function to each value in the grid.
Mod like python, where the remainder has the same sign as b.
NewArraysGrid initializes an empty grid with the given size.
NewPoint is the how we create a new Point.
No description provided by the author
ReadArraysGrid parses the lines and created a Grid with the y-dimension given by the number of lines and the x-dimension given by the length of the first line.
ReadInts assumes there is one integer per line and returns a slice of ints.
ReadIntsFromFile expects a filename that contains a list of ints, one per line.
ReadStrings reads a file and returns a string slice, each strings representing a line.
ReadStringsFromFile expects a filename and returns a slice of strings, one per file in that file.
RenderGrid will render the contents of the grid as a multiline string.
Reverse takes a string and returns the reverse.
Sgn returns 1 for a positive number, -1 for a negative number, and 0 for zero.

# Variables

AllDirections is a slice of all the different offsets that repesent the different directions around a point.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
Can use compass directions as aliases to the above directions if you prefer.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
Can use compass directions as aliases to the above directions if you prefer.
Can use compass directions as aliases to the above directions if you prefer.
Can use compass directions as aliases to the above directions if you prefer.
skip 0,0 */.
Can use compass directions as aliases to the above directions if you prefer.
Can use compass directions as aliases to the above directions if you prefer.
Can use compass directions as aliases to the above directions if you prefer.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
All of these directions (Up Down Left Right) assume "UP" and "LEFT" mean -1 while "DOWN" and "RIGHT" mean +1.
Can use compass directions as aliases to the above directions if you prefer.

# Structs

MaxMin holds onto a maximum and minumum value of an arbitrary number of values.
Point is an immutable data structure representing an X and Y coordinate pair.

# Interfaces

Grid represents a mutable 2D rectangle with a value at each integer coordinate.

# Type aliases

ArraysGrid is a Grid that has an underlying representation of [][]byte.
SparseGrid is a Grid that has an underlying representation of map[Point]byte.