common

package module
v0.0.0-...-f38f987 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MPL-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap

func CopyMap(m map[string]int) map[string]int

func Ingest

func Ingest(name string) ([]byte, error)

Ingest reads a file in to memory.

func ParseMatrix

func ParseMatrix(b []byte) ([][]int, error)

ParseMatrix parses a input bytes in to a matrix of ints.

func PrettyPrintBools

func PrettyPrintBools(matr [][]bool)

func PrettyPrintMatrix

func PrettyPrintMatrix(ints [][]int)

func PrettyPrintStrings

func PrettyPrintStrings(strings [][]string)

func Solve

func Solve(p *Puzzle, solvers ...Solver)

func SplitLines

func SplitLines(b ...[]byte) ([][]string, error)

SplitLines returns a line-by-line string slice of the input []byte(s).

Types

type Data

type Data []byte

func FromStrings

func FromStrings(s ...string) Data

func (Data) AsIntMatrix

func (d Data) AsIntMatrix() ([][]int, error)

ParseMatrix parses a input bytes in to a matrix of ints.

func (Data) AsLines

func (d Data) AsLines() []string

SplitLines returns a line-by-line string slice of the input []byte(s).

func (Data) AsStringMatrix

func (d Data) AsStringMatrix() ([][]string, error)

type Puzzle

type Puzzle struct {
	Sample Data
	Input  Data
}

func Load

func Load() (p *Puzzle, err error)

type Solver

type Solver func(d Data) (string, error)

type XY

type XY struct {
	X, Y int
}

Directories

Path Synopsis
1
2
3
4
5
6
7
8
nolint
nolint
9

Jump to

Keyboard shortcuts

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