util

package
v0.0.0-...-0eefbcb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsoluteValue

func AbsoluteValue[T Number](a, b T) T

func MustAtoi

func MustAtoi(s string) int

func MustParseInt

func MustParseInt(s string) int64

func PrintGrid

func PrintGrid[T any](grid [][]T)

func Transpose

func Transpose[T any](grid [][]T) [][]T

func ValidNeighborsWithDiagonals

func ValidNeighborsWithDiagonals[T comparable](grid [][]T, x, y int) [][2]int

func ValidStandardNeighbors

func ValidStandardNeighbors[T comparable](grid [][]T, i, j int) [][2]int

Types

type Number

type Number interface {
	constraints.Float | constraints.Integer
}

type Scanner

type Scanner struct {
	*bufio.Scanner
	// contains filtered or unexported fields
}

func ReadInputFile

func ReadInputFile(f embed.FS) (*Scanner, error)

func (*Scanner) Close

func (s *Scanner) Close() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL