day12

package
v0.0.0-...-acf6961 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CaveStart = "start"
	CaveEnd   = "end"
)

Variables

This section is empty.

Functions

func Part1

func Part1(cs CaveSystem) (int, error)

func Part2

func Part2(cs CaveSystem) (int, error)

Types

type CaveSystem

type CaveSystem map[string]map[string]struct{}

func NewCaveSystem

func NewCaveSystem(in []string) (CaveSystem, error)

type Caves

type Caves map[string]struct{}

type SearchNode

type SearchNode struct {
	CaveSystem         CaveSystem
	Path               []string
	VisitedSmall       Caves
	AllowedSecondVisit bool
}

func (*SearchNode) IsGoal

func (n *SearchNode) IsGoal() bool

func (*SearchNode) Key

func (n *SearchNode) Key() interface{}

func (*SearchNode) Neighbours

func (n *SearchNode) Neighbours() ([]bfs.Node, error)

func (*SearchNode) String

func (n *SearchNode) String() string

Jump to

Keyboard shortcuts

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