day08

package
v0.0.0-...-9c9a4a3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Left    = 0
	Right   = 1
	Initial = "AAA"
	Final   = "ZZZ"
)

Variables

This section is empty.

Functions

func CompEndingFn

func CompEndingFn(dest uint8) func(s string) bool

func CompFn

func CompFn(dest string) func(s string) bool

func ParseMap

func ParseMap(s string) (Sequence, *Node)

func ParseMap2

func ParseMap2(s string) (Sequence, NodeList)

Types

type Node

type Node struct {
	Value     string
	Neighbors []*Node
}

func (*Node) Steps

func (n *Node) Steps(seq *Sequence, comp func(string) bool) (int, *Node)

type NodeList

type NodeList []*Node

func (NodeList) FindPattern

func (nl NodeList) FindPattern(seq *Sequence) []int

func (NodeList) Print

func (nl NodeList) Print()

func (NodeList) Steps

func (nl NodeList) Steps(seq *Sequence) int

type Sequence

type Sequence struct {
	Current      int
	Instructions []int
}

func (*Sequence) Next

func (seq *Sequence) Next() (int, int)

func (*Sequence) Reset

func (seq *Sequence) Reset()

Jump to

Keyboard shortcuts

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