challenge

package
v0.0.0-...-7d95961 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InputFile

func InputFile() io.Reader

InputFile returns an io.Reader for the file pointed at by the --input flag. If the flag is not specified, it looks for a file named "input.txt" in the same package as the caller.

func Ints

func Ints(r io.Reader) iter.Seq[int]

Ints returns an iter.Seq[int] over all lines in the provided io.Reader, converting each line to an int. This method panics if conversion of any line fails.

func Lines

func Lines(r io.Reader) iter.Seq[string]

Lines returns an iter.Seq[string] over all lines in the provided io.Reader.

func Raw

func Raw(r io.Reader) string

Raw returns the contents of the provided io.Reader as one giant string

func Sections

func Sections(r io.Reader) iter.Seq[string]

Sections returns an iter.Seq[string] over all blocks of lines in the provided io.Reader. Blocks are delimited by two newlines, and the resulting section has leading and trailing whitespace trimmed by strings.TrimSpace

func SectionsOf

func SectionsOf(r io.Reader, delim string) iter.Seq[string]

SectionsOf returns sections of input from the provided io.Reader delimited by the provided string, exclusive. The header up to the first delimiter is returned as the first element in the sequence. Empty sections are omitted.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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