part01

package
v0.0.0-...-1af9f05 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(input string) (Pipeline, []Part, error)

func Sum

func Sum(outcome []Outcome[Part]) int

Types

type Outcome

type Outcome[T any] struct {
	Done bool
	Drop bool
	Key  T
}

type Part

type Part struct {
	X, M, A, S int
}

type Pipeline

type Pipeline struct {
	Moves map[string][]State
}

func (Pipeline) Travel

func (p Pipeline) Travel(parts []Part) []Outcome[Part]

type State

type State func(key string, value int) (Outcome[string], bool)

Jump to

Keyboard shortcuts

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