day08

package
v0.0.0-...-f4b2804 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AAAStartNode

type AAAStartNode struct{}

Defines a start node as a node whose name is AAA

func (AAAStartNode) Determine

func (a AAAStartNode) Determine(name string) bool

type Direction

type Direction int

Direction represents the left and right options that are available

const (
	Right Direction = iota
	Left
)

func ParseDirectionsLine

func ParseDirectionsLine(line string) ([]Direction, error)

type EndNodeDefiner

type EndNodeDefiner interface {
	Determine(string) bool
}

Interface to determine if a Node is a end node

type Exercise

type Exercise struct{}

func (Exercise) Part1

func (e Exercise) Part1(path string) (int, error)

func (Exercise) Part2

func (e Exercise) Part2(path string) (int, error)

type GhostEndNode

type GhostEndNode struct{}

Defines an end node as a node whose name ends in Z

func (GhostEndNode) Determine

func (g GhostEndNode) Determine(name string) bool

type GhostStartNode

type GhostStartNode struct{}

Defines a start node as a node whose name ends in A

func (GhostStartNode) Determine

func (g GhostStartNode) Determine(name string) bool

type Node

type Node struct {
	Name  string
	Left  *Node
	Right *Node
	// contains filtered or unexported fields
}

func NewNode

func NewNode(
	name string,
	snd StartNodeDefiner,
	end EndNodeDefiner,
) *Node

func ParseNodes

func ParseNodes(
	data string,
	snd StartNodeDefiner,
	end EndNodeDefiner,
) (startNodes []*Node, err error)

func (Node) IsEndNode

func (n Node) IsEndNode() bool

func (Node) IsStartNode

func (n Node) IsStartNode() bool

func (Node) String

func (n Node) String() string

type StartNodeDefiner

type StartNodeDefiner interface {
	Determine(string) bool
}

Interface to determine if a Node is a start node

type ZZZEndNode

type ZZZEndNode struct{}

Defines an end node as a node whose name is ZZZ

func (ZZZEndNode) Determine

func (z ZZZEndNode) Determine(name string) bool

Jump to

Keyboard shortcuts

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